Stuck trying to integrate dy/dx-y=cos(x)-2

In summary, the conversation is discussing how to integrate dy/dx-y=cos(x)-2, which is in the form dy/dx+p(x)=q(x). The individual has used the integrating factor method and has encountered difficulties with integrating cos(x)(e^-x). Another person suggests using the Euler formula to simplify the integral. The individual also questions the use of two "/" symbols in the final expression.
  • #1
dooogle
21
0

Homework Statement



integrate

dy/dx-y=cos(x)-2

Homework Equations


The Attempt at a Solution



dy/dx-y=cos(x)-2

is in the form

dy/dx+p(x)=q(x)

take the I.F as e^int(p(x))dx=e^-x

multiplying throughout by e^-x

d(e^-x)z/dx=-(cos(x)e^-x)-(2e^-x)

(e^-x)z=-int((cos(x)e^-x)-(2e^-x))dx

so -int((cos(x)e^-x)-(2e^-x))dx=-int(cos(x)(e^-x)dx-2int(e^-x)dx

2int(e^-x)dx=-2(e^-x)+c

-int(cos(x)(e^-x)) this is where i have trouble I am not sure if my method is correct using integration by parts multiple times

1st integration
let u=e^(-x) du/dx=-e^(-x) dv/dx=cos(x) v=-sin(x)

-int(cos(x)(e^-x))dx = -e^(-x)sin(x)+int(-sin(x)e^(-x))dx

2nd integration
int(-sin(x)e^(-x))dx
let u=e^(-x) du/dx=-e^(-x) dv/dx=-sin(x) v=cos(x)

e^(-x)cos(x)+int(cos(x)(e^-x))dx

so

-int(cos(x)(e^-x)dx=-e^(-x)sin(x)+e^(-x)cos(x)+int(cos(x)(e^-x))dx

this is where I am not sure i take away from both sides int(cos(x)(e^-x))dx giving

-2int(cos(x)(e^-x)dx=-e^(-x)sin(x)+e^(-x)cos(x)

int(cos(x)(e^-x)dx=e^(-x)/2(sin(x)+cos(x))

so
(e^-x)z=-2(e^-x)+c+e^(-x)/2(sin(x)+cos(x))+c

z=-2+(sin(x)+cos(x))/2+c/(e^-x)

1/y=-2+(sin(x)+cos(x))/2+c/(e^-x)

y=1/(-2+(sin(x)+cos(x))/2+c/(e^-x))

thank you for your time to recap my problems is:

im not sure if i am allowed to add integrals

cheers

dooogle
 
Physics news on Phys.org
  • #2
It's easier to do that integral by using the Euler formula

[tex]e^{\pm ix} = \cos x \pm i \sin x[/tex]

to obtain an expression for [tex]\cos x[/tex] in terms of exponentials. However, your integration is correct if you mean

int(cos(x)(e^-x)dx= (e^(-x)/2 ) (sin(x)+cos(x)) +c
 
  • #3
Sorry but the use of two "/"s in
y=1/(-2+(sin(x)+cos(x))/2
is meaning less to me.
 

FAQ: Stuck trying to integrate dy/dx-y=cos(x)-2

How do I solve for dy/dx in the given equation?

To solve for dy/dx, we use the method of separation of variables. We first rearrange the equation to isolate the dy/dx term on one side, and all other terms on the other side. In this case, we would move the -y term to the right side, and the cos(x)-2 terms to the left side. Then, we integrate both sides with respect to x, and solve for dy/dx.

Why is the equation given in this form, with dy/dx on one side and y on the other?

The equation is given in this form because it is a differential equation, which is an equation that relates a function to its derivatives. The left side represents the derivative of y with respect to x, while the right side represents a function of x.

Can I use any method other than separation of variables to solve this equation?

Yes, there are other methods to solve differential equations, such as using a substitution or an integrating factor. However, separation of variables is the most commonly used method for equations in this form.

Is there a specific range of x values for which this equation is valid?

No, this equation is valid for all real numbers of x. However, the solution may be limited to a specific range of x values depending on the initial conditions given for y.

How can I check if my solution for dy/dx is correct?

You can check your solution by taking the derivative of your answer and comparing it to the original equation. If the two are equal, then your solution is correct. You can also plug in the solution for y into the original equation to see if it satisfies the equation.

Back
Top