Section 16.1 Finding the General Solution to a Differential Equation
For a simple example of a first-order differential equation, we will consider the equation
\begin{equation*}
y'=x^2y\text{,}
\end{equation*}
which may also be written as
\begin{equation*}
\frac{dy}{dx} = x^2y\text{.}
\end{equation*}
We can see from the notation of the derivative that \(y\) is a function of \(x\text{.}\) Solutions to this differential equation are functions \(y(x)\) whose derivative satisfy this relationship. Finding these solutions require entirely different methods, so the usual
solve() and fsolve() commands will not work to solve for \(y(x)\text{.}\)
Before solving a differential equation, it is often useful to assign a name to the equation in Maple. When doing this, we must ensure that we write \(y(x)\) in function notation so that the solver properly knows which variable is independent and which is dependent.
> de1 := y'(x)= x^2*y(x);
\begin{equation*}
\displaystyle de\mathit{1}\, := \,{\frac {d}{dx}}y \left( x \right) ={x}^{2}y \left( x \right)
\end{equation*}
Now, to solve the differential equation, we use the
dsolve() command. This command does not require that any special packages are loaded. This command requires that the differential equation is properly using function notation and also requires the function for which to solve for.
> dsolve(de1, y(x));
\begin{equation*}
\displaystyle y \left( x \right) = \_C\mathit{1}\,{{ e}^{1/3\,{x}^{3}}}
\end{equation*}
Due to the nature of indefinite integration, we can expect an arbitrary constant to appear in the solution. In this case, Maple uses \(\_C1\) as an arbitrary coefficient. By default, Maple names the constants \(\_C1, \_C2, \_C3, \ldots \text{ etc }\text{.}\) Since this value is arbitrary, this solution is known as a general solution to the differential equation.
We can clean this up a bit by substituting a βnicerβ constant instead of \(\_C1\text{,}\) using the
subs() command.
> desoln := subs(_C1=A, _C1*exp((1/3)*x^3));
\begin{equation*}
\displaystyle desoln := A\,{{ e}^{1/3\,{x}^{3}}}
\end{equation*}
Relabelling the arbitrary constant gives a much nicer appearance to the general solution for this differential equation. The constant \(A\) from the above example is arbitrary, meaning that the function \(y(x)=A{ e}^{1/3\,{x}^{3}}\) is always a solution for the original differential equation, no matter the value of \(A\text{.}\)
