Calculating the total derivative for a Taylor method

82 Views Asked by At

I am attempting to set up a second-order Taylor method for a second-order ODE $$y''(x) = f(y'(x),y(x))$$ I have substituted a vector $\textbf{u}=(y,y')$ and then a new function $\textbf{g}(x,\textbf{u})=(u^{(2)},f(u^{(2)},u^{(1)}))$

To set up the Taylor method I believe that I need to calculate the total derivative $\frac{d\textbf{g}(x,\textbf{u})}{dx}$ but I'm struggling to do this.

I am able to calculate the partial derivative $\frac{\partial \textbf{g}}{\partial \textbf{u}}$ which I believe comes out as a 2x2 matrix but I am struggling to calculate the partial $\frac{\partial \textbf{g}}{\partial x}$ which I believe is necessary as I am currently working on the assumption that the total derivative I need is $\frac{d\textbf{g}(x,\textbf{u})}{dx}=\frac{\partial \textbf{g}}{\partial x}+\frac{\partial \textbf{g}}{\partial \textbf{u}}\cdot \textbf{g}(x,\textbf{u})$

Am I going about this the right way and if so how do I go about calculating it. Thanks in advance for any help

1

There are 1 best solutions below

0
On

All of those primes and subscripts make it hard for me to follow. I am going to let $v=y^{\prime}$ and then $y^{\prime\prime}=v^{\prime}=f(v,y)$. Then $$y^{(3)}=v^{\prime\prime}=\frac{\partial f}{\partial y}\frac{dy}{dx}+\frac{\partial f}{\partial v}\frac{dv}{dx}=v\frac{\partial f}{\partial y}+f\frac{\partial f}{\partial v}$$ And $$\begin{align}y^{(4)}=v^{(3)}&=\frac{dv}{dx}\frac{\partial f}{\partial y}+v\left(\frac{\partial^2f}{\partial y^2}\frac{dy}{dx}+\frac{\partial^2f}{\partial y\partial v}\frac{dv}{dx}\right)\\ &\quad+\left(\frac{\partial f}{\partial y}\frac{dy}{dx}+\frac{\partial f}{\partial v}\frac{dv}{dx}\right)\frac{\partial f}{\partial v}+f\left(\frac{\partial^2f}{\partial y\partial v}\frac{dy}{dx}+\frac{\partial^2f}{\partial v^2}\frac{dv}{dx}\right)\\ &=f\frac{\partial f}{\partial y}+v^2\frac{\partial^2f}{\partial y^2}+2vf\frac{\partial^2f}{\partial y\partial v}+v\frac{\partial f}{\partial y}\frac{\partial f}{\partial v}+f\left(\frac{\partial f}{\partial v}\right)^2+f^2\frac{\partial^2f}{\partial v^2}\end{align}$$ Gets messy real quick.