How can I solve the differential equation #y'= sinx - xsinx# ?

2 Answers
Apr 4, 2018

General solution for your differential equation is:

#y=(x-1)cosx-sinx+C#

Explanation:

.

#y'=dy/dx=sinx-xsinx#

To find #y#, we have to take the integral of #y'#:

#y=int(sinx-xsinx)dx#

#y=intsinxdx-intxsinxdx=-cosx-I#

#I=intxsinxdx#

The argument of the integral is product of two functions. As such, we will use integration by parts:

#u=x, and dv=sinxdx#

#du=dx, and v=-cosx#

#intudv=uv-intvdu#

#intxsinxdx=-xcosx-int-cosxdx=#

#-xcosx+intcosxdx=-xcosx+sinx#

#I=-xcosx+sinx#

Let's plug it in:

#y=-cosx-(-xcosx+sinx)=-cosx+xcosx-sinx#

#y=(x-1)cosx-sinx+C#

This is the solution to the differential equation in your problem statement.

Apr 4, 2018

The General Solution is:

# y = xcosx - sinx -cosx + C#

Explanation:

We have:

# y' = sinx-xsinx #

Using Leibniz's Notation we can write this as:

# dy/dx = sinx-xsinx #

Which is a First Order Ordinary Differential Equation, so we can "separate the variables" to get:

# int \ dy = int \ sinx-xsinx \ dx #

Leading to:

# y = int \ sinx \ dx - int \ xsinx \ dx + C#

The first integral is trivial, and we require Integration By Parts for the Second integral, as follows:

Let # { (u,=x, => (du)/dx,=1), ((dv)/dx,=sin x, => v,=-cosz ) :}#

Then plugging into the IBP formula:

# int \ (u)((dv)/dx) \ dx = (u)(v) - int \ (v)((du)/dx) \ dx #

We have:

# int \ (x)(sinx) \ dx = (x)(-cosx) - int \ (-cosx)(1) \ dx #

# :. int \ xsinx \ dx = -xcosx + sinx #

Using this result we return to the DE solution to get:

# y = -cosx - {-xcosx + sinx}+ C#
# \ \ = -cosx + xcosx - sinx+ C#
# \ \ = xcosx - sinx -cosx + C#

Which is the General Solution.