Question: How do I use Maple to Solve a Differential Equation in Second-Order Perturbation Theory?

I am working with the following differential equation:

$\frac{d^2z}{dx^2}+z=\frac{\cos 2x}{1+\epsilon z},\:\:\:z(-\pi/4)=z(\pi/4)=0$

where modulus of $\epsilon$ is much less than $1$.  The task is then to use perturbation theory (with Maple, if necessary) to show that the second-order approximation to the solution to this DE is:

$z=-\frac{1}{3}\cos 2x +\epsilon\bigg(\frac{1}{6}-\frac{8\sqrt{2}}{45}\cos x - \frac{1}{90}\cos 4x \bigg) + \epsilon^2 \bigg(\frac{2\sqrt{2}x}{45}\sin x - \frac{\sqrt{2}}{90}(\pi + 1)\cos x + \frac{7}{720} \cos 2x - \frac{\sqrt{2}}{90}\cos 3x - \frac{1}{1050}\cos 6x \bigg).$

I will then likely have to use Maple to determine the third-order term $\delta^{3}z_{3}(x)$ and evaluate $z_{3}(x)$ at $x=0$ and $x-\pi/8$.

My starting point is to use the theory for a regular perturbation (since the modulus of $\epsilon$ is much less than $1$).  For the unperturbed equation, I could set $\epsilon=0$ as that would give a simple differential equation which should be solvable.  I can then see that $1/{1+\epsilon z}$ can be expanded to second-order in $\epsilon$ as $1 - \epsilon z + \epsilon^2 z^2 + O(\epsilon^3), which looks promising.  Could someone advise how I put this together?  Do I then have to multiply the unperturbed solution by the expansion in $\epsilon$? 

Please Wait...