# DIY

As far as I know, ‘bc2’, Maxima’s built-in function for solving two-point boundary value problem only handles the type:

$\begin{cases} y'' = f(x, y, y')\\ y(a)=\alpha, y'(b) = \beta \end{cases}\quad\quad\quad(*)$

For example, solving $\begin{cases} y'' + y (y')^3=0 \\y(0) = 1, y(1)=3 \end{cases}:$

But ‘bc2’ can not be applied to

$\begin{cases} -y'' + 9 y =12 \sin(t)\\ y(0)=y(2\pi), y'(0) = y'(2\pi) \end{cases}$

since it is not the type of (*). However, you can roll your own:

An error occurs on the line where the second boundary condition is specified. It attempts to differentiate the solution with respect to $t$ under the context that $t=0$. i.e.,

diff(rhs(sol), 0);

which is absurd.

The correct way is to express the boundary conditions using ‘at’ instead of ‘ev’:

The following works too as the derivative is obtained before using ‘ev’:

Nonetheless, I still think using ’at’ is a better way: