Integral of a multi-part function

• Nov 22nd 2011, 06:13 AM
sugarmuffin
Integral of a multi-part function
I have two functions

$f(t)=\left\{\begin{array}{ccc}\sqrt{t^2+2\pi t + \pi^2} &\mbox{ if }& t < -\pi \\ \cos{\left(\frac{\pi}{2} - t\right)} & \mbox{ if }& -\pi\leq t \leq \frac{\pi}{2}\\ 1 &\mbox{ if }& t > \frac{\pi}{2} \end{array}\right.$

$S(x)=\int_0 ^x f(t) dt \ \ \ \ -\infty < x < \infty$

I need to write S(x) without the integral sign.

My attempt
I started by trying to find the primitive functions for each part

1.a
$\int \sqrt{t^2 + 2\pi t + \pi^2} dt = \int \sqrt{(x+\pi)^2}= \frac{1}{2}(t+\pi)^2 +C$

2.a
$\int \cos{\left(\frac{\pi}{2}-t\right)} dt=\int \sin{t} dt = -\cos{t} + C$

3.a
$\int 1 dt = t + C$

Now what confuses me a bit is what integrating from 0 to x actually means in this case. Does it just mean that I integrate for the defined interval in each case? Or do I actually calculate things like 1.b here:

1.b
$\frac{1}{2}\left[(t+\pi)^2\right]_0 ^x = \frac{1}{2}\left( (x+\pi)^2 - \pi^2 \right)=\frac{1}{2}(x^2+2\pi x)$

I am also supposed to plot S(x), so I would like to grasp how it works/what it looks like. Right now I just cannot get my head around this.
Any help appreciated.
• Nov 22nd 2011, 06:49 AM
Plato
Re: Integral of a multi-part function
Quote:

Originally Posted by sugarmuffin
I have two functions
$f(t)=\left\{\begin{array}{ccc}\sqrt{t^2+2\pi t + \pi^2} &\mbox{ if }& t < -\pi \\ \cos{\left(\frac{\pi}{2} - t\right)} & \mbox{ if }& -\pi\leq t \leq \frac{\pi}{2}\\ 1 &\mbox{ if }& t > \frac{\pi}{2} \end{array}\right.$

$S(x)=\int_0 ^x f(t) dt \ \ \ \ -\infty < x < \infty$

I need to write S(x) without the integral sign.

This is an extremely messy problem. You are over simplifying it too.

First, if $t\le -\pi$ then $f(t)=-(t+\pi)$.

Second, if $x\le -\pi$ then $\int_0^x {f(t)dt} = \int_0^{ - \pi } {f(t)dt} + \int_{ - \pi }^x{f(t)dt}$

So you should graph each part of the function to see what is going on.
• Nov 22nd 2011, 08:18 AM
sugarmuffin
Re: Integral of a multi-part function

Quote:

This is an extremely messy problem. You are over simplifying it too.
Yeah, honestly it scares the hell out of me.

So a different way to express f(t) could be like below?

$f(t)=\left\{\begin{array}{ccc} \pi - t &\mbox{ if }& t < -\pi \\ \sin{t} & \mbox{ if }& -\pi\leq t \leq \frac{\pi}{2}\\ 1 &\mbox{ if }& t > \frac{\pi}{2} \end{array}\right.$

And if I continue from your example above

$\mbox{ if } x < -\pi \mbox{ then }\int_0 ^x f(t) dt = \int_0 ^{-\pi} f(t) dt + \int_{-\pi} x f(t) dt$

$= \left[\pi t\right]_0 ^{-\pi}-\frac{1}{2}\left[t^2\right]_0 ^{-\pi}+\left[\pi t\right]_{-\pi} ^x -\frac{1}{2}\left[t^2\right]_{-\pi} ^x = \pi x - \frac{1}{2} x^2$

Or am I still over simplifying things?

I am not sure I understand how/why I divide that last integral into two parts. Would the part for 2.a look like below?

$\mbox{ if } -\pi \leq t \leq \frac{\pi}{2} \mbox{ then } \int_0 ^x f(t) dt = \int_0 ^{-\pi} f(t) dt + \int_{-\pi} ^{\frac{\pi}{2}} f(t) dt + \int_{\frac{\pi}{2}} ^x f(t) dt$

• Nov 22nd 2011, 08:33 AM
Plato
Re: Integral of a multi-part function
Quote:

Originally Posted by sugarmuffin
So a different way to express f(t) could be like below?

$f(t)=\left\{\begin{array}{ccc} \pi - t &\mbox{ if }& t < -\pi \\ \sin{t} & \mbox{ if }& -\pi\leq t \leq \frac{\pi}{2}\\ 1 &\mbox{ if }& t > \frac{\pi}{2} \end{array}\right.$

You have a mistake in the first line.
$f(t)=\left\{\begin{array}{ccc} -\pi - t &\mbox{ if }& t < -\pi \\ \sin{t} & \mbox{ if }& -\pi\leq t \leq \frac{\pi}{2}\\ 1 &\mbox{ if }& t > \frac{\pi}{2} \end{array}\right.$
• Nov 22nd 2011, 09:01 AM
sugarmuffin
Re: Integral of a multi-part function
Right, I don't know how I missed that.
Then

$\mbox{ if } x < -\pi \mbox{ then }\int_0 ^x f(t) dt = \int_0 ^{-\pi} f(t) dt + \int_{-\pi} x f(t) dt$
$= \left[-\pi t\right]_0 ^{-\pi}-\frac{1}{2}\left[t^2\right]_0 ^{-\pi}+\left[-\pi t\right]_{-\pi} ^x -\frac{1}{2}\left[t^2\right]_{-\pi} ^x = -\pi x - \frac{1}{2} x^2$

Pretty sure that part is correct now. But I am still a bit confused. Was the second part of my last post correct? The assumption that the part for 2.a would look like below?

$\mbox{ if } -\pi \leq t \leq \frac{\pi}{2} \mbox{ then } \int_0 ^x f(t) dt = \int_0 ^{-\pi} f(t) dt + \int_{-\pi} ^{\frac{\pi}{2}} f(t) dt + \int_{\frac{\pi}{2}} ^x f(t) dt$
• Nov 22nd 2011, 10:44 AM
sugarmuffin
Re: Integral of a multi-part function
Attempt 3

I've ended up with this

$S(x)=\left\{\begin{array}{ccc}-\pi x - \frac{1}{2}x^2 & \mbox{ if } & x < -\pi \\ 1-\cos{x} & \mbox{ if } & -\pi \leq x \leq \frac{\pi}{2} \\ x & \mbox{ if } & x>\frac{\pi}{2}\end{array}\right.$

Is this in any way correct?
I'm not really sure if I am still over simplifying things. And I apologize if these are stupid questions, but I am extremely stressed at the moment and just cannot figure this out.

Again, thanks for the help.
• Nov 22nd 2011, 11:05 AM
Plato
Re: Integral of a multi-part function
Quote:

Originally Posted by sugarmuffin
Attempt 3

I've ended up with this

$S(x)=\left\{\begin{array}{ccc}-\pi x - \frac{1}{2}x^2 & \mbox{ if } & x < -\pi \\ 1-\cos{x} & \mbox{ if } & -\pi \leq x \leq \frac{\pi}{2} \\ x & \mbox{ if } & x>\frac{\pi}{2}\end{array}\right.$

Is this in any way correct?

Did you account for the fact $\int_0^{ - \pi } {f(t)dt}=2~?$
• Nov 22nd 2011, 11:09 AM
sugarmuffin
Re: Integral of a multi-part function
Quote:

Originally Posted by Plato
Did you account for the fact $\int_0^{ - \pi } {f(t)dt}=2~?$

No.. I don't think I did. I have to admit that that completely stumps me, how does that come about?
• Nov 22nd 2011, 11:16 AM
Plato
Re: Integral of a multi-part function
Quote:

Originally Posted by sugarmuffin
No.. I don't think I did. I have to admit that that completely stumps me, how does that come about?

If $x\le -\pi$ then $S(x)=S(-\pi)+\int_{-\pi}^{ x } {f(t)dt}=2+\int_{-\pi}^{ x } {(-\pi-t)dt}$
• Nov 22nd 2011, 11:43 AM
sugarmuffin
Re: Integral of a multi-part function
Ahhh okay, I see what you mean now. But in the original post, $f(t) = -t - \pi \mbox{ if } t < -\pi$

So is $t = -\pi$ really a part of this interval? Can I still use it in the way you have suggested?
I just assumed it would be part of the sin(t) interval, and could only be used there.
• Nov 22nd 2011, 11:58 AM
Plato
Re: Integral of a multi-part function
Quote:

Originally Posted by sugarmuffin
Ahhh okay, I see what you mean now. But in the original post, $\color{red}f(t) = -t - \pi \mbox{ if } t < -\pi$
So is $t = -\pi$ really a part of this interval? Can I still use it in the way you have suggested?
I just assumed it would be part of the sin(t) interval, and could only be used there.

In integrals that makes absolutely no difference.
The value is the same no matter one point.

If $-pi\le x \le\tfrac{\pi}{2}$ then $S(x)=\int_{ 0}^x {\sin(t)dt}$.
Just do straightforward integration. Change no limits around.

If $x\ge\tfrac{\pi}{2}$ then $S(x)=S\left( {\tfrac{\pi }{2}} \right) + \int_{\frac{\pi }{2}}^x {1 dt}$
• Nov 22nd 2011, 01:10 PM
sugarmuffin
Re: Integral of a multi-part function
Okay, this has begun making sense. You sir, are a saint.

It would make sense to first do the middle one:

$\mbox{ If } \ -\pi\le x \le\tfrac{\pi}{2} \ \mbox{ then } \ S(x)=\int_{ 0}^x {\sin(t)dt}=\underline{1-\cos{x}}$.

Then as you said before

$\mbox{ If } \ x \leq -\pi \ \mbox{ then } \ \int_0 ^x f(t) dt = S(-\pi) + \int_{-\pi} ^x f(t) dt$

$= 2 - \frac{1}{2}\left[t^2\right]_{-\pi} ^x - \left[\pi t\right]_{-\pi}^x =\underline{2 -\frac{1}{2}x^2-\pi x - \frac{\pi^2}{2}}$

And then finally with the same logic as before

$\mbox{If } \ x\ge\tfrac{\pi}{2} \ \mbox{ then } S(x)=S\left( {\tfrac{\pi }{2}} \right) + \int_{\frac{\pi }{2}}^x {1 dt} = (1-\cos{\frac{\pi}{2}}) +\left[ t\right]_{\frac{\pi}{2}} ^x =\underline{1 + (x - \frac{\pi}{2})}$

Does this look better?
• Nov 22nd 2011, 01:18 PM
Plato
Re: Integral of a multi-part function
Quote:

Originally Posted by sugarmuffin
Does this look better?

Yes, much better.
• Nov 22nd 2011, 02:29 PM
sugarmuffin
Re: Integral of a multi-part function
I've gone through it a couple of times now. Think I understand what we did fairly well.

Thanks again for your help. Really appreciated.