- #1

- 20

- 0

## Homework Statement

Solve the initial value problem:

$$sin(x)y' + ycos(x) = xsin(x), y(2)= \pi/2$$

## Homework Equations

## The Attempt at a Solution

Recognizing it as a Linear First-Order Equation:$$\frac{dy}{dx}+y\frac{cosx}{sinx}=x$$

$$P(x)=\frac{cosx}{sinx}$$

Integrating factor: $$e^{\int \frac{cosx}{sinx}dx}=sinx$$

Multiplying the ODE by the integrating factor:

$$\frac{d}{dx}[ysinx] = xsinx$$

Integrating both sides: $$ysinx = \int xsinx dx$$

$$y=1-\frac{xcosx}{sinx}+C$$

Solving for C: $$C=1$$

$$y=2-\frac{xcosx}{sinx}$$

Apparently this solution is incorrect, but I can't figure out why?