1. ## Initial value problem

I'm so close to the answer, I've narrowed it down to two possibilites, here is the question:

Find the initial value problem:

$cos(x)dy/dx-ysin(x)=xcos(x)$

$y= -(x)tan(x)+1-4sec(x)$ or $y= (x)tan(x)+1-4sec(x)$

Any help is greatly appreciated!

2. Originally Posted by KennyP33
I'm so close to the answer, I've narrowed it down to two possibilites, here is the question:

Find the initial value problem:

$cos(x)dy/dx-ysin(x)=xcos(x)$

$y= -(x)tan(x)+1-4sec(x)$ or $y= (x)tan(x)+1-4sec(x)$

Any help is greatly appreciated!
Assuming that the IC is $y(0)=-3$, it's the second answer.

3. Originally Posted by KennyP33
I'm so close to the answer, I've narrowed it down to two possibilites, here is the question:

Find the initial value problem:

$cos(x)dy/dx-ysin(x)=xcos(x)$

$y= -(x)tan(x)+1-4sec(x)$ or $y= (x)tan(x)+1-4sec(x)$

Any help is greatly appreciated!
$\cos{x}\frac{dy}{dx} - (\sin{x})y = x\cos{x}$

$\frac{dy}{dx} - (\tan{x})y = x$.

This is first order linear, so use the integrating factor:

$e^{\int{\tan{x}\,dx}} = e^{-\ln{(\cos{x})}} = e^{\ln{\sec{x}}} = \sec{x}$.

Multiplying through by the integrating factor gives:

$\sec{x}\frac{dy}{dx} - (\sec{x}\tan{x})y = x\sec{x}$

The left hand side is a product rule expansion of $(\sec{x})y$, so

$\frac{d}{dx}[(\sec{x})y] = x\sec{x}$

$(\sec{x})y = \int{x\sec{x}\,dx}$.

So $y = \cos{x}\int{x\sec{x}\,dx}$.

4. oh, wow, i forgot to add $y(pi)=5$

5. Originally Posted by Prove It
$\cos{x}\frac{dy}{dx} - (\sin{x})y = x\cos{x}$

$\frac{dy}{dx} - (\tan{x})y = x$.

This is first order linear, so use the integrating factor:

$e^{\int{\tan{x}\,dx}} = e^{-\ln{(\cos{x})}} = e^{\ln{\sec{x}}} = \sec{x}$.

Multiplying through by the integrating factor gives:

$\sec{x}\frac{dy}{dx} - (\sec{x}\tan{x})y = x\sec{x}$

The left hand side is a product rule expansion of $(\sec{x})y$, so

$\frac{d}{dx}[(\sec{x})y] = x\sec{x}$

$(\sec{x})y = \int{x\sec{x}\,dx}$.

So $y = \cos{x}\int{x\sec{x}\,dx}$.
I believe that $P(x) = - \tan x$ and not what you have $P(x) = \tan x$.

6. Originally Posted by KennyP33
oh, wow, i forgot to add $y(pi)=5$
Still - it's the second one.

7. so the one without the negative sign?

8. Originally Posted by KennyP33
so the one without the negative sign?
Yep!

9. Originally Posted by Danny
I believe that $P(x) = - \tan x$ and not what you have $P(x) = \tan x$.
Thanks.

So to fix up my mistake...

The integrating factor is $e^{\int{-\tan{x}\,dx}} = e^{\ln{(\cos{x})}} = \cos{x}$.

So multiplying through we find

$\cos{x}\,\frac{dy}{dx} - (\sin{x})y = x\cos{x}$.

The LHS is a product rule expansion, so

$\frac{d}{dx}[(\cos{x})y] = x\cos{x}$

So $(\cos{x})y = \int{x\cos{x}\,dx}$.

Now integrating by parts with $u = x$ so that $du = 1$ and $dv = \cos{x}$ so that $v = \sin{x}$, we have

$(\cos{x})y = x\sin{x} - \int{\sin{x}\,dx}$

$(\cos{x})y = x\sin{x} + \cos{x} + C$

$y = x\tan{x} + 1 + C\sec{x}$.