dy/dx+2y=sinx,

The answer is:1/5(2sinx+cosx)+cwith e to the power (-2x)

To solve the given differential equation, we can use the method of integrating factors. Here are the steps to find the solution:

Step 1: Rewrite the equation in the standard form:
dy/dx + 2y = sin(x)

Step 2: Identify the coefficients:
The coefficient of the derivative term (dy/dx) is 1, and the coefficient of the dependent variable (y) is 2.

Step 3: Calculate the integrating factor:
The integrating factor (IF) is given by the exponential function of the integral of the coefficient of y with respect to x. In this case, the coefficient of y is 2, so we calculate the integral of 2 dx:
IF = e^(∫2 dx) = e^(2x)

Step 4: Multiply the entire differential equation by the integrating factor (IF):
e^(2x) * (dy/dx) + 2e^(2x) * y = e^(2x) * sin(x)

Step 5: Apply the product rule to the left side:
(d/dx)(e^(2x) * y) = e^(2x) * sin(x)

Step 6: Integrate both sides with respect to x:
∫(d/dx)(e^(2x) * y) dx = ∫e^(2x) * sin(x) dx

Step 7: Apply the basic integration rules:
e^(2x) * y = ∫e^(2x) * sin(x) dx

Step 8: Solve the integral on the right side:
To solve the integral, we can use integration by parts. Applying the formula ∫u dv = uv - ∫v du, let:
u = sin(x) => du = cos(x) dx
dv = e^(2x) dx => v = (1/2) * e^(2x)

Thus, the integral becomes:
e^(2x) * y = (1/2) * e^(2x) * sin(x) - ∫(1/2) * e^(2x) * cos(x) dx

Step 9: Solve the new integral on the right side:
Again, we can apply integration by parts. Let:
u = cos(x) => du = -sin(x) dx
dv = (1/2) * e^(2x) dx => v = (1/4) * e^(2x)

Substituting these values, we have:
e^(2x) * y = (1/2) * e^(2x) * sin(x) - (1/4) * e^(2x) * cos(x) - ∫(1/4) * e^(2x) * (-sin(x)) dx
e^(2x) * y = (1/2) * e^(2x) * sin(x) - (1/4) * e^(2x) * cos(x) + (1/4) * ∫e^(2x) * sin(x) dx

Notice that the integral on the right side is equal to the original equation, so we can substitute it:
e^(2x) * y = (1/2) * e^(2x) * sin(x) - (1/4) * e^(2x) * cos(x) + (1/4) * (e^(2x) * y)

Step 10: Simplify and isolate y:
Bring all terms involving y on one side:
e^(2x) * y - (1/4) * (e^(2x) * y) = (1/2) * e^(2x) * sin(x) - (1/4) * e^(2x) * cos(x)

Combining like terms:
(3/4) * e^(2x) * y = (1/2) * e^(2x) * sin(x) - (1/4) * e^(2x) * cos(x)

Divide both sides by (3/4) * e^(2x) to solve for y:
y = (1/2) * e^(2x) * sin(x) / [(3/4) * e^(2x)] - (1/4) * e^(2x) * cos(x) / [(3/4) * e^(2x)]

Simplifying the expression:
y = (2/3) * sin(x) - (1/3) * cos(x) * e^(-2x)

Step 11: Add the constant of integration:
The general solution of a differential equation contains the constant of integration (c). Adding c to the solution, we have:
y = (2/3) * sin(x) - (1/3) * cos(x) * e^(-2x) + c

Therefore, the solution to the given differential equation is:
y = (2/3) * sin(x) - (1/3) * cos(x) * e^(-2x) + c