Second-Order ODE Calculator

Type ay'' + by' + cy = g(x), and optionally y(x₀) and y'(x₀), to solve it.

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: two conditions at the same point, such as y(0) = 0, y'(0) = 1. Leave empty for the general solution, with C1 and C2.

Try

Result

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

y=ex(C1 cos⁡(2x)+C2 sin⁡(2x))\displaystyle y = e^{x}\left(C_{1}\,\cos\left(2x\right) + C_{2}\,\sin\left(2x\right)\right)
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=−2, c=5a = 1,\ b = -2,\ c = 5 and g(x)=0g(x) = 0.

    y′′−2y′+5y=0y'' - 2y' + 5y = 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−2r+5=0D=b2−4ac=−16\begin{gathered} r^2 - 2r + 5 = 0 \\ D = b^2 - 4ac = -16 \end{gathered}
  4. Complex roots

    D<0D < 0, so the roots are α±βi\alpha \pm \beta i with α=1\alpha = 1 and β=2\beta = 2; the real solutions are eαxcos⁡βxe^{\alpha x}\cos\beta x and eαxsin⁡βxe^{\alpha x}\sin\beta x.

    Using y=eαx(C1cos⁡βx+C2sin⁡βx)y = e^{\alpha x}(C_1\cos\beta x + C_2\sin\beta x)

    yh=ex(C1cos⁡2x+C2sin⁡2x)y_h = e^{x}\left(C_1\cos 2x + C_2\sin 2x\right)
  5. General solution

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

    y=ex(C1 cos⁡(2x)+C2 sin⁡(2x))y = e^{x}\left(C_{1}\,\cos\left(2x\right) + C_{2}\,\sin\left(2x\right)\right)
  6. Result

    The general solution, with arbitrary constants.

Worked examples