# Can you separate the integral of product functions?

• December 30th 2008, 12:40 PM
mdunnbass
Can you separate the integral of product functions?
Hi everyone,

This may be a very simple 'No', but it's been going on 15 years since I've had any regular calculus quality time, so I can't remember. if I have the integral of

A(x) * B(x) dx,

is there a way to separate that into 2 independent integrals?

And, second question, is there a simple integral of

dx/(1+A*cos(x)),

(where A is constant) or is that an elliptic integral?

Thanks!

Matt
• December 30th 2008, 12:49 PM
Mathstud28
Quote:

Originally Posted by mdunnbass
Hi everyone,

This may be a very simple 'No', but it's been going on 15 years since I've had any regular calculus quality time, so I can't remember. if I have the integral of

A(x) * B(x) dx,

is there a way to separate that into 2 independent integrals?

No. In general $\int f\cdot g~dx\ne \int f~dx\cdot\int g~dx$

For quick counterexample to the opposite of above is $f=x,g=e^x$.

Quote:

And, second question, is there a simple integral of

dx/(1+A*cos(x)),

(where A is constant) or is that an elliptic integral?

Thanks!

Matt
Try the substitution $x=2\arctan(z)$ (Hi)

If you have any problems stop back!
• December 30th 2008, 12:52 PM
galactus
Quote:

Hi everyone,

This may be a very simple 'No', but it's been going on 15 years since I've had any regular calculus quality time, so I can't remember. if I have the integral of

A(x) * B(x) dx,
Parts is often a choice for something like this.

Quote:

And, second question, is there a simple integral of

dx/(1+A*cos(x)),

(where A is constant) or is that an elliptic integral?
This has a general form.

$\displaystyle\frac{ 2tanh^{-1}\left(\displaystyle\frac{(A-1)tan(\frac{x}{2})}{\sqrt{(a-1)(A+1)}}\right)}{\sqrt{(A+1)(A-1)}}$
• December 31st 2008, 07:30 AM
mdunnbass
Quote:

Originally Posted by Mathstud28
No. In general $\int f\cdot g~dx\ne \int f~dx\cdot\int g~dx$

For quick counterexample to the opposite of above is $f=x,g=e^x$.

Thanks. Actually, the post by galactus reminded me to look into Integration by parts, and the Wiki page mentions this:

$\int f\cdot g~dx = f \int g~dx - \int ( f' \int g~dx ) ~dx$

So, I'm going to try the substitution you mentioned below, and see what I can find. I have a feeling that I am in reality trying to invent a very old and well-worn wheel, but, as I'm just dabbling in my spare time, I don't mind.

THank you though for your suggestions!

Quote:

Originally Posted by Mathstud28
Try the substitution $x=2\arctan(z)$ (Hi)

If you have any problems stop back!

Do you mean, given the integral I mentioned in my OP, change it to integrate WRT z instead of x, such that $z = tan(x/2)$? I'll see what I can figure out.

Thanks!
Matt
• December 31st 2008, 07:33 AM
mdunnbass
Quote:

Originally Posted by galactus
Parts is often a choice for something like this.

This has a general form.

$\displaystyle\frac{ 2tanh^{-1}\left(\displaystyle\frac{(A-1)tan(\frac{x}{2})}{\sqrt{(a-1)(A+1)}}\right)}{\sqrt{(A+1)(A-1)}}$

So, 3 things. First, I love the joke in your sig. I almost spit milk out my nose, and I haven't even drunk any milk this week. Second, thanks for the help on the integral, as well as the reference to parts. Third - I saw that $tanh$, and immediately shuddered. I never did understand the hyperbolic functions back in high school, and never went back to them later....
• December 31st 2008, 11:13 AM
mdunnbass
Quote:

Originally Posted by galactus
$\displaystyle\frac{ 2tanh^{-1}\left(\displaystyle\frac{(A-1)tan(\frac{x}{2})}{\sqrt{(a-1)(A+1)}}\right)}{\sqrt{(A+1)(A-1)}}$

Now that I am looking at this in more detail, I am not sure how you got from A to B. Is there someplace you could point me that might explain the process you took?

What my original post boiled down to was that I am trying to figure out :

$\int\displaystyle\frac{1 + cos \theta}{1 + A*cos \theta} ~d\theta$

over the interval from $0 - 2 \pi$, where A is a constant. I don't know how to do it, so I was trying to tease out possible strategies without blatantly asking people to do it for me.

By trying integration by parts, given

$\int f(x)*g(x) = f(x) * \int g(x)~dx - \int [f'(x) \int g(x)~dx]~dx$

I set
$g(x) = 1+cos \theta$
and
$f(x) = 1+a*cos \theta$
such that I could substitute the first half of the parts equation in as follows:
$f(x) * \int g(x)~dx = \displaystyle\frac{\theta + sin \theta}{1 + A*cos \theta}$
and the second part would be:
$\int(f'(x) \int g(x)~dx)~dx = \int [f'(x)*(\theta + sin \theta)]~d\theta$

It's calculating $f'(x)$ that I am tripping myself. my first impulse is to think that since the exponent is -1, just multiply f(x) by negative 1 and decrease the exponent to negative 2, but there is a huge nagging image of my Calc teacher yelling something about throwing in the derivative of cos(theta) as well. But then I think, well, simplifying the second terms results in the integral of the derivative of f(x), and isn't that just f(x)?

Or did I go wrong long before all that?

Matt
• December 31st 2008, 11:24 AM
galactus
If you use the sub that mathstud suggested(it's called the Weierstrauss

substitution) it works out OK.

$x=2tan^{-1}(u), \;\ dx=\frac{2}{u^{2}+1}du, \;\ u=tan(\frac{x}{2})$

Then, upon making the subs, it whittles down to:

$2\int\frac{du}{(a-1)u^{2}-a-1}$

Integrate and resub.

The solution may be different than the one I posted, but equivalent.
• December 31st 2008, 01:30 PM
Mathstud28
Here you go my friend:

$\int\frac{dx}{a+b\cos(x)}$

Let $x\longmapsto 2\arctan(z)$ so we get $dx=\frac{2}{1+z^2}dz$. So subbing gives

$\int\frac{dx}{a+b\cos(x)}\stackrel{x=2\arctan{z}}{ \longmapsto}2\int\frac{1}{a+b\cos\left(2\arctan(z) \right)}\cdot\frac{dz}{1+z^2}$

Now remember three things

$\cos(2\phi)=\cos^2(\phi)-\sin^2(\phi)\quad(1)$
$\cos(\arctan(\phi))=\frac{1}{\sqrt{1+\phi^2}}\quad (2)$
$\sin(\arctan(\phi))=\frac{\phi}{\sqrt{1+\phi^2}}\q uad(3)$

So combining these three things we can see that

\begin{aligned}\cos\left(2\arctan(z)\right)&=\cos^ 2\left(\arctan(z)\right)-\sin^2\left(\arctan(z)\right)\\
&=\left(\frac{1}{\sqrt{1+z^2}}\right)^2-\left(\frac{z}{\sqrt{1+z^2}}\right)^2\\
&=\frac{1}{1+z^2}-\frac{z^2}{1+z^2}\end{aligned}

So

\begin{aligned}2\int\frac{dz}{a+b\cos\left(2\arcta n(z)\right)}\cdot\frac{1}{1+z^2}&=2\int\frac{dz}{a +\frac{b}{1+z^2}-\frac{bz^2}{1+z^2}}\cdot\frac{1}{1+z^2}\\
&=2\int\frac{dz}{a(1+z^2)+b-bz^2}\\
&=2\int\frac{dz}{(a-b)z^2+a+b}\end{aligned}

Now consider this. We can rewrite $(a-b)z^2$ as $\left(\sqrt{a-b}z\right)^2$

So now make a trig sub $\sqrt{a-b}z\longmapsto\sqrt{a+b}\tan(\vartheta)$ so $dz=\frac{\sqrt{a+b}}{\sqrt{a-b}}\sec^2(\vartheta)d\vartheta$

Subbing this gives

\begin{aligned}2\int\frac{dz}{\left(\sqrt{a-b}z\right)^2+a+b}&\stackrel{\sqrt{a-b}z=\sqrt{a+b}\tan(\vartheta)}{\longmapsto}2\frac{ \sqrt{a+b}}{\sqrt{a-b}}\int\frac{\sec^2(\vartheta)}{\left(\sqrt{a+b}\t an(\vartheta)\right)^2+a+b}d\vartheta\\
&=\frac{2}{\sqrt{a-b}\sqrt{a+b}}\int\frac{\sec^2(\vartheta)}{\tan^2(\ vartheta)+1}d\vartheta\end{aligned}

Now remember that

\begin{aligned}\tan^2(\phi)+1&=\frac{\sin^2(\phi)} {\cos^2(\phi)}+1\\
&=\frac{\sin^2(\phi)+\cos^2(\phi)}{\cos^2(\phi) }\\
&=\frac{1}{\cos^2(\phi)}\\
&=\sec^2(\phi)\end{aligned}

So

\begin{aligned}\frac{2}{\sqrt{a-b}\sqrt{a+b}}\int\frac{\sec^2(\vartheta)}{\tan^2(\ vartheta)+1}d\vartheta&=\frac{2}{\sqrt{a-b}\sqrt{a+b}}\int~d\vartheta\\
&=\frac{2\vartheta}{\sqrt{a-b}\sqrt{a+b}}\end{aligned}

So we must make our tedious backsubs

$\sqrt{a-b}z=\sqrt{a+b}\tan(\vartheta)\implies \arctan\left(\frac{\sqrt{a-b}z}{\sqrt{a+b}}\right)=\vartheta$

But now remember that $x=2\arctan(z)\implies \tan\left(\frac{x}{2}\right)=z$

So we finally get

$\int\frac{dx}{a+b\cos(x)}=\frac{2\arctan\left(\fra c{\sqrt{a-b}\tan\left(\frac{x}{2}\right)}{\sqrt{a+b}}\right) }{\sqrt{a^2-b^2}}+C$

I hope that helps (Hi)
• December 31st 2008, 01:35 PM
galactus
Go Mathstud(Clapping)
• January 2nd 2009, 08:46 AM
mdunnbass
Quote:

Originally Posted by Mathstud28
Here you go my friend:

$\int\frac{dx}{a+b\cos(x)}$

Let $x\longmapsto 2\arctan(z)$ so we get $dx=\frac{2}{1+z^2}dz$. So subbing gives

$\int\frac{dx}{a+b\cos(x)}\stackrel{x=2\arctan{z}}{ \longmapsto}2\int\frac{1}{a+b\cos\left(2\arctan(z) \right)}\cdot\frac{dz}{1+z^2}$

Now remember three things

$\cos(2\phi)=\cos^2(\phi)-\sin^2(\phi)\quad(1)$
$\cos(\arctan(\phi))=\frac{1}{\sqrt{1+\phi^2}}\quad (2)$
$\sin(\arctan(\phi))=\frac{\phi}{\sqrt{1+\phi^2}}\q uad(3)$

So combining these three things we can see that

\begin{aligned}\cos\left(2\arctan(z)\right)&=\cos^ 2\left(\arctan(z)\right)-\sin^2\left(\arctan(z)\right)\\
&=\left(\frac{1}{\sqrt{1+z^2}}\right)^2-\left(\frac{z}{\sqrt{1+z^2}}\right)^2\\
&=\frac{1}{1+z^2}-\frac{z^2}{1+z^2}\end{aligned}

So

\begin{aligned}2\int\frac{dz}{a+b\cos\left(2\arcta n(z)\right)}\cdot\frac{1}{1+z^2}&=2\int\frac{dz}{a +\frac{b}{1+z^2}-\frac{bz^2}{1+z^2}}\cdot\frac{1}{1+z^2}\\
&=2\int\frac{dz}{a(1+z^2)+b-bz^2}\\
&=2\int\frac{dz}{(a-b)z^2+a+b}\end{aligned}

Now consider this. We can rewrite $(a-b)z^2$ as $\left(\sqrt{a-b}z\right)^2$

So now make a trig sub $\sqrt{a-b}z\longmapsto\sqrt{a+b}\tan(\vartheta)$ so $dz=\frac{\sqrt{a+b}}{\sqrt{a-b}}\sec^2(\vartheta)d\vartheta$

Subbing this gives

\begin{aligned}2\int\frac{dz}{\left(\sqrt{a-b}z\right)^2+a+b}&\stackrel{\sqrt{a-b}z=\sqrt{a+b}\tan(\vartheta)}{\longmapsto}2\frac{ \sqrt{a+b}}{\sqrt{a-b}}\int\frac{\sec^2(\vartheta)}{\left(\sqrt{a+b}\t an(\vartheta)\right)^2+a+b}d\vartheta\\
&=\frac{2}{\sqrt{a-b}\sqrt{a+b}}\int\frac{\sec^2(\vartheta)}{\tan^2(\ vartheta)+1}d\vartheta\end{aligned}

Now remember that

\begin{aligned}\tan^2(\phi)+1&=\frac{\sin^2(\phi)} {\cos^2(\phi)}+1\\
&=\frac{\sin^2(\phi)+\cos^2(\phi)}{\cos^2(\phi) }\\
&=\frac{1}{\cos^2(\phi)}\\
&=\sec^2(\phi)\end{aligned}

So

\begin{aligned}\frac{2}{\sqrt{a-b}\sqrt{a+b}}\int\frac{\sec^2(\vartheta)}{\tan^2(\ vartheta)+1}d\vartheta&=\frac{2}{\sqrt{a-b}\sqrt{a+b}}\int~d\vartheta\\
&=\frac{2\vartheta}{\sqrt{a-b}\sqrt{a+b}}\end{aligned}

So we must make our tedious backsubs

$\sqrt{a-b}z=\sqrt{a+b}\tan(\vartheta)\implies \arctan\left(\frac{\sqrt{a-b}z}{\sqrt{a+b}}\right)=\vartheta$

But now remember that $x=2\arctan(z)\implies \tan\left(\frac{x}{2}\right)=z$

So we finally get

$\int\frac{dx}{a+b\cos(x)}=\frac{2\arctan\left(\fra c{\sqrt{a-b}\tan\left(\frac{x}{2}\right)}{\sqrt{a+b}}\right) }{\sqrt{a^2-b^2}}+C$

I hope that helps (Hi)

Yes, absolutely, it helps tremendously. Now, if I try to work through things on my own, given the equation I am truly interested in:

$\int\frac{1+cos(\theta)}{1+b\cdot cos(\theta)}~d\theta$

if I start off with the same substitution you do, I need to take care of the cos term now in the numerator. So,

$cos(\theta) = cos(2arctan(z))$
$cos(2x) = cos^2 (x) - sin^2 (x)$
$cos(2arctan(z)) = cos^2 (arctan(z)) - sin^2 (arctan(z))$
$cos(2arctan(z)) = \frac{1}{1+ z^2 } - \frac{z^2 }{1+ z^2 }$

putting this into the larger equation, we get
$2\int\frac{1 + \frac{1 - z^2}{1+ z^2}}{a+b\cos\left(2\arctan(z)\right)}\cdot\frac{d z}{1+z^2}$

simplifying the numerator then gives:
$4\int\frac{\frac{1}{1+ z^2}}{a+b\cos\left(2\arctan(z)\right)}\cdot\frac{d z}{1+z^2}$

Am I right so far?

Now, should I continue from here with the same substitution of
$z=\frac{\sqrt{a+b}}{\sqrt{a-b}}tan(\theta)$?
Or should I choose a different function than tan?

Thanks,
Matt
• January 2nd 2009, 06:39 PM
Mathstud28
Eh, you can do it that way...but try seperating the integrals and considering

$\int\frac{\cos(x)}{a+b\cos(x)}dx=\int\frac{\cos(x) }{1+a\sqrt{1-\sin^2(x)}}dx\stackrel{\varphi=\sin(x)}{\longmapst o}\int\frac{d\varphi}{a+b\sqrt{1-\varphi^2}}$
• January 5th 2009, 07:51 AM
mdunnbass
Quote:

Originally Posted by Mathstud28
Eh, you can do it that way...but try seperating the integrals and considering

$\int\frac{\cos(x)}{a+b\cos(x)}dx=\int\frac{\cos(x) }{1+a\sqrt{1-\sin^2(x)}}dx\stackrel{\varphi=\sin(x)}{\longmapst o}\int\frac{d\varphi}{a+b\sqrt{1-\varphi^2}}$

Thanks! Now, thinking back, and looking around, I know that

$\int\frac{d\varphi}{\sqrt{1-\varphi^2}} = \arcsin(\varphi)$

and if I try

$\int\frac{d\varphi}{b\cdot\sqrt{1-\varphi^2}} = \frac{\arcsin(\varphi)}{b}$

But, throwing that 'a' term in there is confusing the dickens out of me. Is there a way to work around that?

Matt
• January 5th 2009, 08:20 AM
mdunnbass
Quote:

Originally Posted by mdunnbass
Thanks! Now, thinking back, and looking around, I know that

$\int\frac{d\varphi}{\sqrt{1-\varphi^2}} = \arcsin(\varphi)$

and if I try

$\int\frac{d\varphi}{b\cdot\sqrt{1-\varphi^2}} = \frac{\arcsin(\varphi)}{b}$

But, throwing that 'a' term in there is confusing the dickens out of me. Is there a way to work around that?

Matt

Wow. I just tried an online integral calculator (no idea how accurate, it's at Online Integral Calculator ), and the result it spat out, given the form above was that it cold not be integrated. But, when I removed the $\varphi = \sin(x)$ substitution, and let a=1, was:

$\int\frac{\cos(x)}{1+b\cdot\cos(x)}dx =$ $-\frac{2\cdot\sqrt{1-b}\cdot\sqrt{1+b}\cdot\arctan(\frac{\sin(x)}{\cos( x)+1}) - 2\cdot\arctan(\frac{\sqrt{1+b}\cdot(\sin(x)}{\sqrt {1-b}\cdot(\cos(x)+1)})}{b\cdot\sqrt{1-b}\cdot\sqrt{1+b}}$

based on whether $(b-1)\cdot(b+1)$ was positive or negative. But, it gave no suggestion as to how that was all computed. I am not one to look a gift horse in the mouth, but since I started trying to figure these integrals out solely for the excuse to play with math, I'd rather not include a 'wave magic wand *here*' step.

Any ideas how this came about? Of course, this is all moot if I am integrating from 0 to 2 $\pi$, as all the arctan terms become 0.

Matt
• January 5th 2009, 12:15 PM
Mathstud28
Quote:

Originally Posted by mdunnbass
Wow. I just tried an online integral calculator (no idea how accurate, it's at Online Integral Calculator ), and the result it spat out, given the form above was that it cold not be integrated. But, when I removed the $\varphi = \sin(x)$ substitution, and let a=1, was:

$\int\frac{\cos(x)}{1+b\cdot\cos(x)}dx =$ $-\frac{2\cdot\sqrt{1-b}\cdot\sqrt{1+b}\cdot\arctan(\frac{\sin(x)}{\cos( x)+1}) - 2\cdot\arctan(\frac{\sqrt{1+b}\cdot(\sin(x)}{\sqrt {1-b}\cdot(\cos(x)+1)})}{b\cdot\sqrt{1-b}\cdot\sqrt{1+b}}$

based on whether $(b-1)\cdot(b+1)$ was positive or negative. But, it gave no suggestion as to how that was all computed. I am not one to look a gift horse in the mouth, but since I started trying to figure these integrals out solely for the excuse to play with math, I'd rather not include a 'wave magic wand *here*' step.

Any ideas how this came about? Of course, this is all moot if I am integrating from 0 to 2 $\pi$, as all the arctan terms become 0.

Matt

Yes, this is most likely the correct answer. It is not exactly the same result as mine, but I am sure with an elementary manipulation this reduces to my antiderivative.

To handle the integral that I left you with try multiplying the by denominator's conjugate, i.e. $\frac{a-b\sqrt{1-\varphi^2}}{a-b\sqrt{1-\varphi^2}}$. Alternatively, before ever subbing $\varphi=\sin(x)$ you can make the sub $x=2\arctan(\vartheta)$ similar to the first integral.

Note that we can "simplify" this slightly

\begin{aligned}\int\frac{\cos(x)}{a+b\cos(x)}~dx&= \frac{1}{b}\int\frac{a+b\cos(x)-a}{a+b\cos(x)}~dx\\
&=\frac{1}{b}\int\left\{1-\frac{a}{a+b\cos(x)}\right\}~dx\end{aligned}

From there you can just use the original integral. A little easier than my first suggestion :D...but only because we previously calculated that integral.