# First order ode

1. Sep 22, 2013

### tylersmith7690

1. The problem statement, all variables and given/known data

For the following differential equation:

dy/dx = $\frac{2cos^2x-sin^2x+y^2}{2 cosx}$ , -pi/2 < x < pi/2

show that the substitution y(x)=sin x + 1/u(x) yeilds the differential equation for u(x),

du/dx = -u tan x - $\frac{1}{2}$sec x

Hence find the solution y(x) to the original differential equation that satisfies the condition y(0)=2
Find the interval on which the solution to the initial value problem is defined.

2. Relevant equations

I have no idea where to go next to get y(x).

3. The attempt at a solution

using y= sinx + 1/u
dy/dx = cos x - 1/u^2 du/dx

then let this dy/dx = dy/dx in the original equation and solve for du.

cos x $\frac{-1}{u^2}$du/dx = $\frac{2cos^2x-sin^2x+y^2}{2cosx}$

cos x$\frac{-1}{u^2}$du/dx= $\frac{2 cos^2x+ (2/u) sinx + 1/u^2}{2cosx}$

$\frac{-1}{u^2}$du/dx = $\frac{1}{u}$$\frac{sinx}{cosx}$+$\frac{1}{u^2}$$\frac{1}{2cosx}$

times through by -1/u^2

du/dx= -u tan x -1/2 sec x

Now du/dx + u tanx = -1/2 sec x, which is a first order linear equation

so integrating factor is I= sec x

so , sec x dx/du + u tanx sec x = -1/2 sec^2 x

so sec x u= $\int -(1/2). sec^2 x$

= - 1/2 tan x +C

divide through by sec x

u= -1/2 sin x + C(cos x) [general solution]

now if i sub in u= 1/(y-sin x)

i cant rearrange it to get y by itself. This is where im stuck.

Sorry for the poor latex use. I have little knowledge of it atm.

2. Sep 22, 2013

### Simon Bridge

You have a solution: $u(x)=\frac{1}{2}\sin x + C\cos x$
You want to sub in: $u(x)=1/(y(x)-\sin x)$
... and make y(x) the subject?

I don't see the problem - blind substitution gives you:
$$\frac{1}{y(x)-\sin x} = \frac{1}{2}\sin x + C\cos x$$ ... you got this far right?
Put the RHS under a common denominator then invert both sides.
Note: this is also a LaTeX lesson ;)

3. Sep 22, 2013

### tylersmith7690

I dont see how you get y by itself. Maybe my algebra is way off. And i believe the RHS should have a negative before the 1/2 sin x.

Any help would be welcomed.

4. Sep 22, 2013

### Simon Bridge

Please note: I am not allowed to do the working for you.
Put the RHS under a common denominator then invert both sides - as suggested in post #2.

Exercise:
Make y the subject in this example:
$$\frac{1}{y+5}=\frac{x}{2}+2$$

5. Sep 22, 2013

### tylersmith7690

1/ (y-sinx) = -sinx/2 + C cosx

= (-sinx +2 C cos x)/2

y-sinx = 2/(-sinx +2 C cos x)

y= 2/(-sinx +2 C cos x) +sin x

y= [2 + sinx ( 2 cosx - sin x)]/ 2 cos x - sin x

y = (2 + 2 C sin x cos x -sin^2 x ) / ( 2 cos x - sin x)

y= 2+ C sin 2x - sin^2x / 2 cos x - sinx

This obviously cant be true because i need to find c and cant do this if i sub y=2 and x=0. But yeah thats my attempt.

6. Sep 22, 2013

### Simon Bridge

Start with the step I put in boldface (above). Here it's formatted for you: $$y=\frac{2}{2C\cos x - \sin x}+\sin x$$ ... now find C given (x,y)=(0,2).