I'm trying to symbolically integrate functions that are defined piecewise in Ryacas but I don't know how to define them properly. In this example evaluation of the function gives the correct values at several points but the integrator is not able to determine the integral / antiderivative.
Does yacas have indicator functions built in or can I somehow define them so I could write the function as the product of a function and an indicator function?
library("Ryacas")
yac("g(x) := If((x > 0 And x <= 4), 1, 0)")
yac("g(-1)")
yac("g(3)")
yac("g(5)")
yac("Integrate(x) g(x)")
yac("Integrate(x, -1, 5) g(x)")