# Second Order Differential Equation Calculator

A interactive calculator to solve second order differential equations , with constant coefficients, is presented.

## Overview

A linear second-order homogeneous differential equation with constant coefficients $$a$$, $$b$$, and $$c$$ has the general form [1] , [2] , [3] : $a \frac{d^2y}{dt^2} + b \frac{dy}{dt} + c y = 0$ To solve this differential equation using the auxiliary equation (or characteristic equation), we first find the roots of the auxiliary equation , which is obtained by assuming a solution of the form $$y(t) = e^{rt}$$, hence $$y'(t) = r e^{rt}$$ and $$y''(t) = r^2 e^{rt}$$.
Substitute $$y(t)$$, hence $$y'(t)$$ and $$y''(t)$$ in the differential equation and factor as follows
$(a r^2 + b r + c) e^{rt} = 0$ Since $$e^{rt}$$ cannot be equal to zero, we end up with the auxiliary equation corresponding to the differential equation as: $a r^2 + b r + c = 0$

## Steps to Solve Using the Auxiliary Equation

1. Write down the auxiliary equation: $a r^2 + b r + c = 0$ The nature of the roots of the auxiliary equation determines the behavior of the solutions:
Let $$\Delta = b^2 - 4 \; a \; c$$
1 - If $$\Delta > 0$$ , the roots
$$r_1 = \dfrac{-b+\sqrt{b^2 - 4ac}}{2\;a}$$ and $$r_2 = \dfrac{-b-\sqrt{b^2 - 4ac}}{2\;a}$$
are real and distinct. The general solution involves exponential functions as follows.
$y(t) = C_1 e^{r_1 t} + C_2 e^{r_2 t}$ where $$C_1$$ and $$C_2$$ are constant to be determined using initial conditions.
2 - If $$\Delta = 0$$ , the roots $$r_1$$ and $$r_2$$ are real and equal to $$-\dfrac{b}{2 \; a}$$. The general solution involves a linear function in $$t$$ multiplied by an exponential function.
$y(t) = ( C_1 + C_2 \; t ) e^{r_1 t}$ and $$C_1$$ and $$C_2$$ are constants determined by initial or boundary conditions.
3 - If $$\Delta \lt 0$$ , the roots $$r_1$$ and $$r_2$$ are complex conjugates of the form
$$r_1 = \dfrac{- b + i \sqrt{4 a c - b^2}}{2 \;a}$$ and $$r_2 = \dfrac{- b - i \sqrt{4 a c - b^2}}{2 \;a }$$
The general solurion to the differential equation involves sine and cosine functions as follows. $y(t) = e^{\alpha \; t} \left( C_1 \cos(\beta t) + C_2 \sin(\beta \; t) \right)$ where
$$\alpha = \dfrac{- b }{2 \;a}$$ and $$\beta = \dfrac{ \sqrt{4 a c - b^2} }{2 \;a}$$
and $$C_1$$ and $$C_2$$ are constants determined by initial or boundary conditions.

## Use of Calculator: Enter Coefficients and Initial Conditions

Enter the coefficients $$a, b , c$$ and the initial conditions $$y(0)$$ and $$y'(0)$$ as real numbers and press "Solve".

Solution