## 30 Reputation

2 years, 160 days

## How do I use Maple to Solve a Differenti...

Maple

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$? ## How to Diagonalize a Matrix with Maple?... I am working on a quantum mechanics problem and would like to get a 4x4 matrix A into diagonal form such that A=UDU^{-1}. Basically I just need to know the values of D and U required to make A a diagonal matrix (where D is diagonal) as I can then use it to do an explicit calculation for a matrix exponential. As it is the matrix is not diagonal, so I cannot use the explicit expression for the matrix exponential. Is there a code with Maple that can calculate D and U simply? The matrix is 4 x 4 and has elements 1 0 0 1 0 -1 1 0 0 1 -1 0 1 0 0 1 ## How to Quantify the Difference between R... Maple I am considering a Fourier series$cos (\alpha x) = \frac{1}{2}a_0 + \sum_{k=1}^{\infty}a_k cos(kx)$for x between -pi and pi. I have also shown using a different Fourier series that cos (\alpha x) has an alternative representation: \frac{cos(\alpha x)}{\sin \alpha \pi} = \frac{1}{\pi \alpha} (1 + \frac{(\alpha \ pi)^2}{6} - \frac{\alpha x^2}{2 \pi} + \frac{2*\alpha^3}{\pi}\sum_{k=1}^{\infty}\frac{(-1)^{k-1}}{k^2(k^2 - \alpha^2}*cos(kx)$.

To show that the second representation is a better approximation, I need to find the number of terms for this series and the original Fourier series needed for there to be a difference of 10^{-3} from the exact value of cos(\alpha \pi), assuming that \alpha = 0.75.  Could someone advise how I might do this?

## Piecewise Definition of a Green's Functi...

Maple

I have just begun to study Green's functions and made some initial progress on a problem, but now need Maple to make further progress.  Apologies, I have written up the equations in LaTeX form rather than Maple, as my Maple has gotten very rusty.

$\frac{d^4y}{dx^4}=f(x) y(0)=y'(0)=0, y(1)=y'(1)=0$

I showed that the Green function $G(x,u)$ for this equation satisfies a condition

$\lim_{\epsilon\to0}\bigg[\frac{\partial^3G}{\partial x^3}\bigg]_{x=u-\epsilon}^{u+\epsilon}=1$

and showed that there is continuity of the Green's function and its first and second partial derivatives with respect to $x$ at $x=u$.  The next step is to show that this function has a piecewise definition such that

$G=\frac{1}{6}x^2(1-u)^2(3u - 2ux -x$ for x between the range 0 and u and such that

\[G(x,u)=\frac{1}{6}u^2(1-x^2)(3x - 2xu - u) for x between u and 1

I am not entirely sure how to do this with pen and paper, so I have reason to believe that it could be a done a lot more easily with Maple, if someone could give some pointers that would be much appreciated.

## Writing a Procedure for a Series Represe...

Maple

I am attempting to write a series representation of a general integral of a function from a to b as follows:

int(f(x), x = a..b)= h*sum((c_k)*f(a+kh))+O(h^p),k=1..N;

where h:=(b-a)/(N+1), p(N) is greater than or equal to N + 1 and c_k are coefficients.  I then need to write procedures with Maple to evalue c_k from 1,..,N and also to evaluate P(N) for any N.  If I take the case for N = 3 and N = 6 I have to use those procedures to prove that:

int(f(x), x = a..b)=(4h/3)*(2*f_1 - f_2 +2*f_3) + O(h^5) = (7*h/1440)*(611*(f_1 + f_6) - 453*(f_2 + f_5) + 562*(f_3 + f_4)) + O(h^7)

where f_k = f(a + kh).  I am really at a loss as to how to write this procedure, although I may have used something similar before: