Differential Equation Calculator

Type the equation, with y', y'' (up to y''''), and optionally initial conditions to get the solution.

Write y' and y'' (or dy/dx and d^2y/dx^2): y' + 2y = 4 or y'' - 3y' + 2y = 0. Type powers with ^ and functions with brackets: e^x, sin(x), ln(x).

Optional: y(0) = 2 for a first-order equation, or y(0) = 0, y'(0) = 1 for a second-order one. Leave empty for the general solution.

Try

Result

You enteredy′′−3y′+2y=0y'' - 3y' + 2y = 0

y=C1 ex+C2 e2x\displaystyle y = C_{1}\,e^{x} + C_{2}\,e^{2x}
Show the work
  1. Type of equation

    This is a second-order linear equation with constant coefficients and a zero right side, solved through its characteristic equation.

  2. Second-order linear equation

    The equation has constant coefficients: ay′′+by′+cy=g(x)ay'' + by' + cy = g(x) with a=1, b=−3, c=2a = 1,\ b = -3,\ c = 2 and g(x)=0g(x) = 0.

    y′′−3y′+2y=0y'' - 3y' + 2y = 0
  3. Characteristic equation

    Try y=erxy = e^{rx}: it solves ay′′+by′+cy=0ay'' + by' + cy = 0 exactly when rr is a root of the characteristic equation.

    Using ar2+br+c=0ar^2 + br + c = 0

    r2−3r+2=0D=b2−4ac=1\begin{gathered} r^2 - 3r + 2 = 0 \\ D = b^2 - 4ac = 1 \end{gathered}
  4. Two distinct real roots

    D>0D > 0, so there are two real roots r1≠r2r_1 \ne r_2 and the solutions are er1xe^{r_1x} and er2xe^{r_2x}.

    Using y=C1er1x+C2er2xy = C_1e^{r_1x} + C_2e^{r_2x}

    r=−b±D2a=1, 2  ⇒  yh=C1 ex+C2 e2xr = \frac{-b \pm \sqrt{D}}{2a} = 1,\ 2 \;\Rightarrow\; y_h = C_{1}\,e^{x} + C_{2}\,e^{2x}
  5. General solution

    The right side is zero, so the general solution is yhy_h.

    y=C1 ex+C2 e2xy = C_{1}\,e^{x} + C_{2}\,e^{2x}
  6. Result

    The general solution, with arbitrary constants.

Worked examples