# How can I solve the differential equation y'=sin x−xsin x ?

How can I solve the differential equation $y\prime =\mathrm{sin}x-x\mathrm{sin}x$?
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

incibracy5x
$y\prime =\frac{dy}{dx}=\mathrm{sin}x-x\mathrm{sin}x$
To find y, we have to take the integral of y':
$y=\int \left(\mathrm{sin}x-x\mathrm{sin}x\right)dx$
$y=\int \mathrm{sin}xdx-\int x\mathrm{sin}xdx=-\mathrm{cos}x-I$
$I=\int x\mathrm{sin}xdx$
The argument of the integral is product of two functions. As such, we will use integration by parts:
$u=x,\phantom{\rule{1ex}{0ex}}\text{and}\phantom{\rule{1ex}{0ex}}dv=\mathrm{sin}xdx$
$du=dx,\phantom{\rule{1ex}{0ex}}\text{and}\phantom{\rule{1ex}{0ex}}v=-\mathrm{cos}x$
$\int udv=uv-\int vdu$
$\int x\mathrm{sin}xdx=-x\mathrm{cos}x-\int -\mathrm{cos}xdx=$
$-x\mathrm{cos}x+\int \mathrm{cos}xdx=-x\mathrm{cos}x+\mathrm{sin}x$
$I=-x\mathrm{cos}x+\mathrm{sin}x$
Let's plug it in:
$y=-\mathrm{cos}x-\left(-x\mathrm{cos}x+\mathrm{sin}x\right)=-\mathrm{cos}x+x\mathrm{cos}x-\mathrm{sin}x$
$y=\left(x-1\right)\mathrm{cos}x-\mathrm{sin}x+C$
This is the solution to the differential equation in your problem statement.