Topic: Defining a Piece-wise Function to Integrate
I currently plot a piece-wise function as a set of functions on each necessary subinterval to obtain the graph of the piecewise function. I would love to be able to have Graph calculate the definite integral of the piece-wise defined function, which is all of the functions put together. Right now, if I use the definite integral function, it will only give me the result for each piece; not the graph treated as a whole.
I'm trying to define a custom function which is a single function so that Graph can calculate the definite integral, but I am not having luck.
For instance, to be able to graph f(x) = x for x<1 and g(x) = -(x-1)^2+1 for x>=1. Be able to define h(x) = f(x) + g(x), and have Graph integrate h(x) from x=0 to x=2.
I've attached a graph file of a piece-wise function and shading to represent the integral I'd like Graph to be able to calculate. If you know how to have Graph calculate that integral in one shot let me know.