# Ordinary differential equations

• Jan 15th 2009, 12:00 PM
Troutfisch
Ordinary differential equations
I want to solve the differential equation:

dy/dx=sin(x) + y.tan(x)

Using the integrating factor method I rearrange in the required form of :

dy/dx + g(x)y = h(x) to give:

dy/dx - tan(x).y = sin(x)

The integrating factor p(x) = exp[Sg(x) dx] where in this case
g(x) = -tan(x) (S represents integration !)

But the integral of tan(x) depends on whether x is negative or positive, and since -pi/2 < x < pi/2 I'm left in a bit of a pickle as to how to proceed! If I use the two integrals for the positive and negative values and integrate between limits things get a bit messy, and I grind to a halt.

If I use the modulus sign for tan (x) and push on then I obtain the integrating factor of p(x)= cos(x).

On multiplying through the differential equation by p(x), the R.H.S. then becomes Cos(x)Sin(x). Following the proceedure for the I.F. method, I first write the l.h.s. as d/dx[p(x)y] and then integrate both sides. I now have the problem of trying to integrate Cos(x)Sin(x) and again grind to a halt.

The final answer for the initial condition y(0)= 1/2 :
y = sec x -1/2 cos x but it's the integrating factor I'm after to get there.

The general solution before applying the initial conditions is:

y = C sec x -1/2 Cos x

I have tried to go in reverse from the G.S. but didn't get far!

I apologise if it seems I'm coming on here only to take and not give to the forum, I 've had to re-register after last year, not that I was the most prolific/helpfull poster anyway.

Any help would be much appreciated.

Cheers.
• Jan 15th 2009, 12:17 PM
Moo
Hello,

Quote:

I now have the problem of trying to integrate Cos(x)Sin(x) and again grind to a halt.
$\displaystyle \int \cos(x) \sin(x) ~dx=\frac 12 \int \sin(2x) ~ dx$

:)

I think that your problem with the arctan is not very important, because of the integration constant. I'm sorry I can only help for the point above, because I don't know the other methods :(
• Jan 15th 2009, 12:45 PM
Troutfisch
Quote:

Originally Posted by Moo
Hello,

$\displaystyle \int \cos(x) \sin(x) ~dx=\frac 12 \int \sin(2x) ~ dx$

:)

Thanks for the reply, but how have you gone about integrating Cos(x)Sin(x) ? Is it something you recognise? A standard integral? or (more likely??) a trig identity? Which part of maths do I have to go back and re-re-re-re-revise again (Headbang) the knowledge is falling out as fast as I can get it in!

Cheers.
• Jan 15th 2009, 01:06 PM
Moo
Quote:

Originally Posted by Troutfisch
Thanks for the reply, but how have you gone about integrating Cos(x)Sin(x) ? Is it something you recognise? A standard integral? or (more likely??) a trig identity? Which part of maths do I have to go back and re-re-re-re-revise again (Headbang) the knowledge is falling out as fast as I can get it in!

Cheers.

It's the double angle formula (Nod) :
$\displaystyle \sin(2x)=2\sin(x)\cos(x)$

Or you can just recall that cos is the derivative of sine, and foresee a substitution : $\displaystyle t=\sin(x)$ (hence dt=cos(x) dx and the integral becomes $\displaystyle \int t ~dt$)

One will give $\displaystyle -\cos(2x)+c$, the other one will give $\displaystyle \frac{\sin^2(x)}{2}+c$, which are in fact equivalent thanks to the identity $\displaystyle \cos(2x)=1-2\sin^2(x)$
• Jan 15th 2009, 01:57 PM
Troutfisch
Quote:

Originally Posted by Moo
It's the double angle formula (Nod) :
$\displaystyle \sin(2x)=2\sin(x)\cos(x)$

Yo're almost a star (Wink) bear with me while I make sure I've got this.

Pushing on from my first post, I take the modulus of tan(x), so the integrating factor becomes Cos (x). Multiplying through the d.e. by the Cos(x) and following the necessary procedure I'm left with:

Cos(x).y = S Cos(x)Sin(x) dx

Using the D.A. formulae, then:

Cos(x)y = 1/2 S sin(2x)dx (remember S is integrate)

On integrating:

Cos(x)y = -1/4 Cos(2x) +C (C=constant of integration).

Rearrange for y:

y = C.Sec(x) -1/4 Cos(2x)Sec(x)

But this does not equate to the given general solution of:

y= C.Sec(x) - 1/2 Cos(x) .......or are they equivalent?

But!1! if I now apply the initial condition of y(0) = 1/2 I obtain the particular solution of:

y=3/4 Sec(x) - 1/4 Cos(2x)Sec(x) compared to the given solution of :

y = sec(x) - 1/2 Cos(x)

Hmmm, maybe my G.S. isn't correct after all!
• Jan 16th 2009, 05:13 AM
Troutfisch
Quote:

Originally Posted by Moo
It's the double angle formula (Nod) :
$\displaystyle \sin(2x)=2\sin(x)\cos(x)$

Or you can just recall that cos is the derivative of sine, and foresee a substitution : $\displaystyle t=\sin(x)$ (hence dt=cos(x) dx and the integral becomes $\displaystyle \int t ~dt$)

One will give $\displaystyle -\cos(2x)+c$, the other one will give $\displaystyle \frac{\sin^2(x)}{2}+c$, which are in fact equivalent thanks to the identity $\displaystyle \cos(2x)=1-2\sin^2(x)$

It's taken me some time (a day!), but all the info I needed was there and I've crunched it out in the end.

Many thanks.