# Math Help - DE help

1. ## DE help

y' + ytanx = cosx; y(x) = (x+C)cosx; y(pi) = 0

2. This is first order linear, so use the integrating factor method.

The integrating factor is $e^{\int{\tan{x}\,dx}} = e^{\ln{\sec{x}}} = \sec{x}$.

So multiplying through gives

$\sec{x}\,\frac{dy}{dx} + y\sec{x}\tan{x} = 1$

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

$y\sec{x} = \int{1\,dx}$

$y\sec{x} = x + C$

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

Now substituting the boundary condition

$0 = (\pi + C)\cos{\pi}$

$0 = -\pi - C$

$C = -\pi$.

Therefore $y = (x - \pi)\cos{x}$.