# Did I do this First order linear differential equation right?

##
y'-ytanx = 2xsinxcosx

Ok so I was told I.F. = #e^(intF(x))#

and I got y=cosx(sinx-xcosx)+C

Is this right? If not, please help me?

y'-ytanx = 2xsinxcosx

Ok so I was told I.F. =

and I got y=cosx(sinx-xcosx)+C

Is this right? If not, please help me?

##### 2 Answers

#### Explanation:

The integrating factor for a linear first order equation

is given by

For our case

Thus the integrating factor is

Thus, we multiply both sides of the equation by

This yields

The left hand side is

and this means that

The integral can be evaluated easily by integration by parts to yield

and thus the solution is

# y = -2/3xcos^2x + 2/3tanx - 2/9sin^3xsecx + Csecx #

#### Explanation:

We have:

# y'-ytanx = 2xsinxcosx #

We can use an integrating factor when we have a First Order Linear non-homogeneous Ordinary Differential Equation of the form;

# dy/dx + P(x)y=Q(x) #

So, we can put the equation in standard form:

# y' - (tanx)y = 2xsinxcosx #

Then the integrating factor is given by;

# I = e^(int P(x) dx) #

# \ \ = exp(int \ -tanx) \ dx) #

# \ \ = exp(-lnsecx) #

# \ \ = exp(lncosx) #

# \ \ = cosx #

And if we multiply the DE [A] by this Integrating Factor,

# :. cosxy' - cosx(tanx)y = cosx 2xsinxcosx # #

# :. cosxy' - sinxy = 2xsinxcos^2x #

# :. d/dx (cosx \ y) = 2xsinxcos^2x #

This is now separable, so by *"separating the variables"* we get:

# cosx \ y = int \ 2x \ sinx \ cos^2x \ dx#

Now, consider the integral:

# I = int \ 2x \ sinx \ cos^2x \ dx #

We can then apply Integration By Parts:

Let

# { (u,=2x, => (du)/dx,=2), ((dv)/dx,=sinx \ cos^2x, => v,=-1/3cos^3x ) :}#

Then plugging into the IBP formula:

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

We have:

# int \ (2x)(sinx \ cos^2x) \ dx = (2x)(-1/3cos^3x) - int \ (-1/3cos^3x)(2) \ dx #

# :. I = -2/3xcos^3x + 2/3 \ int \ cos^3x \ dx #

So, next we must consider the integral:

# I_1 = int \ cos^3x \ dx #

# \ \ \ = int \ cosx \ cos^2x \ dx #

# \ \ \ = int \ cosx \ (1-sin^2x) \ dx #

# \ \ \ = int \ cosx \ dx - int \ cosx \ sin^2x \ dx #

# \ \ \ = sinx - 1/3sin^3x #

Combining these results, we have

# I = -2/3xcos^3x + 2/3 {sinx - 1/3sin^3x} #

# \ \ = -2/3xcos^3x + 2/3sinx - 2/9sin^3x #

So that, returning to the DE, we have:

# cosx \ y = -2/3xcos^3x + 2/3sinx - 2/9sin^3x + C #

# :. y = 1/cosx{-2/3xcos^3x + 2/3sinx - 2/9sin^3x + C} #

# :. y = -2/3xcos^2x + 2/3tanx - 2/9sin^3xsecx + Csecx #