Calculus

dy/dx + 2y = x

Step-by-step solution with explanation

Final Answer

, where C is an arbitrary constant

Step-by-step solution

1

Identify the integrating factor

This is a first-order linear ODE in the form dy/dx + P(x)y = Q(x), where P(x) = 2. We find the integrating factor by raising e to the integral of P(x).
2

Multiply both sides by integrating factor

Multiplying every term by e^(2x) transforms the left side into the derivative of a product. This is the key move that makes the equation solvable.
3

Rewrite left side as a derivative

The left side is exactly the derivative of (e^(2x) · y) by the product rule. Recognizing this is the whole point of the integrating factor method.
4

Integrate both sides

We integrate both sides with respect to x. The left side becomes e^(2x)·y. The right side needs integration by parts.
5

Use integration by parts on right side

Let u = x and dv = e^(2x)dx. Then du = dx and v = e^(2x)/2. Applying integration by parts: uv − ∫v du = (x·e^(2x)/2) − ∫(e^(2x)/2)dx = xe^(2x)/2 − e^(2x)/4 + C.
6

Solve for y by dividing by e^(2x)

Divide every term on both sides by e^(2x). This isolates y and gives us the general solution, which includes the constant C to represent the family of all solutions.

Understanding this problem

Learning Insight

The integrating factor method works because it forces the left side of the equation to become a perfect derivative (a product rule result). Once that happens, you only need to integrate both sides — turning a differential equation into an algebra problem. The e^(2x) 'integrates away' on the left because of how exponential derivatives work.

Quick Tip

For dy/dx + ky = f(x) with a constant k, the integrating factor is always e^(kx), and your answer will always have a Ce^(−kx) term on the end. Spot that pattern and you can write down the structure of the answer immediately.

Common Mistake

Students forget to add the constant of integration C before dividing by the integrating factor, or they accidentally write +Ce^(2x) instead of +Ce^(−2x) when dividing by e^(2x).