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. Note that this command can be used without needing to load any special packages. The dsolve() command requires two parameters; the first is the differential equation, which must be properly defined using function notation, and the second is the function that we wish to solve for.
> desoln1 := dsolve(de1, y(x));
\begin{equation*}
\displaystyle desoln1 := 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 using the
subs() command to replace \(\_C1\) by a βnicerβ constant.
> desoln2 := subs(_C1=A, rhs(desoln1));
\begin{equation*}
\displaystyle desoln2 := 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{.}\)
