If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

# Definite integral of piecewise function

Sal evaluates definite integral of a piecewise function over an interval that goes through the two cases of the function.

## Want to join the conversation?

• hello,

I don't understand why we can split the integral in two distinct integral.

the first from -1 to 0 and the second from 0 to 1.

f(x) = x+1 for value of x < 0

so f(x) = x+1 is not defined for 0

what I am missing ?

thanks

best regards

please forgive my approximate English, I'm French. • It is one of the properties of the definite integral. The definite integral is just the area under the function point x=a to x=b. Now if you pick a point x=c between (a,b) and draw a line there, wouldn't the area from a to b is the same as a to c plus c to b? It's easier to see with a graphical illustration. So try to do that.
• My apologies if this sounds like a stupid question, but since it is x<0, then why are we writing the integral from -1 to 0 if it is less than 0? We could have written it from -1 to 0 if it was x<or equal to zero. So, what am I doing wrong? • Hi Oliver,

I don't think you really answered redsondeathstroke40's question ^^
I understand the principle of cutting two functions and glueing them back together.
However, what makes it possible to use F(-1) - F(0) as the area under the curve for the first equation, since this equation doesn't include 0 ?

Now, I think I get it : since the result of both equations for x=0 happens to be 0, it doesn't change the result to operate in this way. But wouldn't this lead to a mistake if it weren't the case ?
• At seconds, wouldn't it be better to take the limit as some arbitrary letter (I used "n") approaches zero for the top bound of the first definite integral in that pair? I ask because the way the function is defined says "x+1" is not defined for x=0, but cos(pix) is. • At I am confused about why 1/π is used instead of of π . Please, help! • So, in the last derivative expression that Sal gives (d/dx[sin(pix)] = picos(pix)), we know that if we have a picos(pix) somewhere, we can easily go to the antiderivative of sin(pix). However, the problem is that we have no coefficient of pi in our integral.

This is okay though! We can add in a coefficient of pi, as long as we counteract it with a 1/pi. This is because pi x 1/pi just equals 1 and we're not changing our integral if we're multiplying by one.

Since we now have a pi as a coefficient, we can substitute in sin(pix) for picos(pix) and the 1/pi will just stay as a remnant from our earlier manipulation.

It is a little bit more straightforward if you use actual u-substitution, so I definitely recommend tackling the integral that way if you know how to.
• At , x+1 is not define at x = 0, is it okay to take the integral of f(x) at the interval [-1, 0]? • that's one of the properties of definite integrals.

it is easier to see if we visualize both parts of the function at x=0.

the limit of x+1 as x approach 0 is 1.

cos(πx)=1 when x=0.

this means we have a continuous function at x=0.

now, sal doesn't graph this, but you can do it to understand what's going on at x=0.

if we have 3 x'es a, b and c, we can see if a(integral)b+b(integral)c=a(integral)c.

in this case we have a=-1, b=0 and c=1.

so the integrals can be added together if the left limit of x+1 and the right limit of cos(πx) is equal at x=0.

i hope this was a little helpful!
• I saw in one of the videos the that when you are taking the definite integral from a to b, a and b are included. In this video Sal uses 0 for the upper bound for the first integral. If the piecewise function defines using x + 1 only for x < 0, why are we allowed to use 0 for the upper bound? Thanks in advance! • We are allowed to use zero as the upperbound because the function is continuous at x = 0. The limit as the piecewise function approaches zero from the left is 0+1=1, and the limit as it approaches from the right is Cos(Pi*0)=Cos(0)=1. We separate the integral from -1 to 1 into two separate integrals at x=0 because the area under the curve from -1 to 0 is different than the are under the curve from 0 to 1. The functions evaluated at x=0 are the same, so adding the two definite integrals after we evaluate them at their A's & B's gives us the total area of the piecewise function from -1 to 1. I hope that helps!
• Would the definite integral of this piecewise function still be the same if the function weren't defined at x=0? • It depends what happens at x=0. If there is a vertical asymptote, then you might still be able to find that area anyway... think about it again after you've studied convergent series. If it's a removable discontinuity, then removing one point from the function is subtracting an area of 0 from the total, and it should still be the same answer as if it were defined at 0.   