In [1]:
from __future__ import division
from sympy import *
from IPython.display import display, Math, Latex
from IPython.core.display import display_html
init_session(quiet=True, use_latex='mathjax')
init_printing()


IPython console for SymPy 0.7.6 (Python 2.7.8-32-bit) (ground types: python)

In [2]:
def format_deriv(arg, itau, idel):
    """ 
    A function for giving a nice latex representation of 
    the partial derivative in question 
    """
    if itau+idel == 1:
        numexp = ''
    else:
        numexp = '^{{{s:d}}}'.format(s=itau+idel)
        
    if itau == 0:
        tau = ''
    elif itau == 1:
        tau = '\\partial \\tau'
    else:
        tau = '\\partial \\tau^{{{s:d}}}'.format(s=itau)
        
    if idel == 0:
        delta = ''
    elif idel == 1:
        delta = '\\partial \\delta'
    else:
        delta = '\\partial \\delta^{{{s:d}}}'.format(s=idel)
        
    temp = '\\frac{{\\partial{{{numexp:s}}} {arg:s}}}{{{{{tau:s}}}{{{delta:s}}}}} = '
    return temp.format(**locals())

Derivatives of $\Delta$


In [30]:
B_i, a_i, tau, delta, XX = symbols('B_i, a_i, tau, delta, XX')
theta = symbols('theta', cls=Function)(tau, delta)
Delta = theta**2+B_i*((delta-1)**2)**a_i
display(Math('\\Delta = ' + latex(Delta)))

#c_i, beta_i = symbols('c_i, beta_i')
#_theta = (1-tau) + c_i*((delta-1)**2)**(1/(2*beta_i))

def deriv(idel, itau):
    dd = diff(diff(Delta, tau, itau), delta, idel)
    dd = dd.subs(((delta-1)**2)**(a_i)/(delta-1)**idel, XX)
    dd = factor(dd, XX)
    dd = dd.subs(XX, ((delta-1)**2)**(a_i)/(delta-1)**idel)
    
    #dd = use(dd, simplify, 1)
    display(Math(format_deriv('\Delta',itau,idel)
                 + latex(dd)))
    #el = diff(diff(Delta, tau, itau), delta, idel)
    #args = dict(c_i = 0.7, beta_i = 0.3, B_i = 0.3, a_i = 3.5, tau = 1.3, delta = 0.9) 
    #for n in range(1,5):
    #    for _itau in range(0,n+1):
    #        s = diff(diff(_theta, tau, _itau), delta, n-_itau).subs(args)
    #        el = el.replace(diff(diff(theta, tau, _itau), delta, n-_itau), s)
    #el = el.subs(theta, _theta)
    #print el.subs(args).evalf()

for n in range(1,5):
    for itau in range(0,n+1):
        deriv(itau, n-itau)


$$\Delta = B_{i} \left(\left(\delta - 1\right)^{2}\right)^{a_{i}} + \theta^{2}{\left (\tau,\delta \right )}$$
$$\frac{\partial{} \Delta}{{\partial \tau}{}} = 2 \theta{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \theta{\left (\tau,\delta \right )}$$
$$\frac{\partial{} \Delta}{{}{\partial \delta}} = \frac{2 B_{i} a_{i} \left(\left(\delta - 1\right)^{2}\right)^{a_{i}}}{\delta - 1} + 2 \theta{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \theta{\left (\tau,\delta \right )}$$
$$\frac{\partial{^{2}} \Delta}{{\partial \tau^{2}}{}} = 2 \theta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \theta{\left (\tau,\delta \right )} + 2 \left(\frac{\partial}{\partial \tau} \theta{\left (\tau,\delta \right )}\right)^{2}$$
$$\frac{\partial{^{2}} \Delta}{{\partial \tau}{\partial \delta}} = 2 \left(\theta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \theta{\left (\tau,\delta \right )} + \frac{\partial}{\partial \delta} \theta{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \theta{\left (\tau,\delta \right )}\right)$$
$$\frac{\partial{^{2}} \Delta}{{}{\partial \delta^{2}}} = 2 \theta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \theta{\left (\tau,\delta \right )} + 2 \left(\frac{\partial}{\partial \delta} \theta{\left (\tau,\delta \right )}\right)^{2} + \frac{2 \left(\left(\delta - 1\right)^{2}\right)^{a_{i}}}{\left(\delta - 1\right)^{2}} \left(2 B_{i} a_{i}^{2} - B_{i} a_{i}\right)$$
$$\frac{\partial{^{3}} \Delta}{{\partial \tau^{3}}{}} = 2 \theta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \tau^{3}} \theta{\left (\tau,\delta \right )} + 6 \frac{\partial}{\partial \tau} \theta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \theta{\left (\tau,\delta \right )}$$
$$\frac{\partial{^{3}} \Delta}{{\partial \tau^{2}}{\partial \delta}} = 2 \left(\theta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta\partial \tau^{2}} \theta{\left (\tau,\delta \right )} + \frac{\partial}{\partial \delta} \theta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \theta{\left (\tau,\delta \right )} + 2 \frac{\partial}{\partial \tau} \theta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \theta{\left (\tau,\delta \right )}\right)$$
$$\frac{\partial{^{3}} \Delta}{{\partial \tau}{\partial \delta^{2}}} = 2 \theta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{2}\partial \tau} \theta{\left (\tau,\delta \right )} + 4 \frac{\partial}{\partial \delta} \theta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \theta{\left (\tau,\delta \right )} + 2 \frac{\partial}{\partial \tau} \theta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \theta{\left (\tau,\delta \right )}$$
$$\frac{\partial{^{3}} \Delta}{{}{\partial \delta^{3}}} = 2 \theta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{3}} \theta{\left (\tau,\delta \right )} + 6 \frac{\partial}{\partial \delta} \theta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \theta{\left (\tau,\delta \right )} + \frac{2 \left(\left(\delta - 1\right)^{2}\right)^{a_{i}}}{\left(\delta - 1\right)^{3}} \left(4 B_{i} a_{i}^{3} - 6 B_{i} a_{i}^{2} + 2 B_{i} a_{i}\right)$$
$$\frac{\partial{^{4}} \Delta}{{\partial \tau^{4}}{}} = 2 \theta{\left (\tau,\delta \right )} \frac{\partial^{4}}{\partial \tau^{4}} \theta{\left (\tau,\delta \right )} + 8 \frac{\partial}{\partial \tau} \theta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \tau^{3}} \theta{\left (\tau,\delta \right )} + 6 \left(\frac{\partial^{2}}{\partial \tau^{2}} \theta{\left (\tau,\delta \right )}\right)^{2}$$
$$\frac{\partial{^{4}} \Delta}{{\partial \tau^{3}}{\partial \delta}} = 2 \left(\theta{\left (\tau,\delta \right )} \frac{\partial^{4}}{\partial \delta\partial \tau^{3}} \theta{\left (\tau,\delta \right )} + \frac{\partial}{\partial \delta} \theta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \tau^{3}} \theta{\left (\tau,\delta \right )} + 3 \frac{\partial}{\partial \tau} \theta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta\partial \tau^{2}} \theta{\left (\tau,\delta \right )} + 3 \frac{\partial^{2}}{\partial \delta\partial \tau} \theta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \theta{\left (\tau,\delta \right )}\right)$$
$$\frac{\partial{^{4}} \Delta}{{\partial \tau^{2}}{\partial \delta^{2}}} = 2 \theta{\left (\tau,\delta \right )} \frac{\partial^{4}}{\partial \delta^{2}\partial \tau^{2}} \theta{\left (\tau,\delta \right )} + 4 \frac{\partial}{\partial \delta} \theta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta\partial \tau^{2}} \theta{\left (\tau,\delta \right )} + 4 \frac{\partial}{\partial \tau} \theta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{2}\partial \tau} \theta{\left (\tau,\delta \right )} + 2 \frac{\partial^{2}}{\partial \delta^{2}} \theta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \theta{\left (\tau,\delta \right )} + 4 \left(\frac{\partial^{2}}{\partial \delta\partial \tau} \theta{\left (\tau,\delta \right )}\right)^{2}$$
$$\frac{\partial{^{4}} \Delta}{{\partial \tau}{\partial \delta^{3}}} = 2 \theta{\left (\tau,\delta \right )} \frac{\partial^{4}}{\partial \delta^{3}\partial \tau} \theta{\left (\tau,\delta \right )} + 6 \frac{\partial}{\partial \delta} \theta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{2}\partial \tau} \theta{\left (\tau,\delta \right )} + 2 \frac{\partial}{\partial \tau} \theta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{3}} \theta{\left (\tau,\delta \right )} + 6 \frac{\partial^{2}}{\partial \delta^{2}} \theta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \theta{\left (\tau,\delta \right )}$$
$$\frac{\partial{^{4}} \Delta}{{}{\partial \delta^{4}}} = 2 \theta{\left (\tau,\delta \right )} \frac{\partial^{4}}{\partial \delta^{4}} \theta{\left (\tau,\delta \right )} + 8 \frac{\partial}{\partial \delta} \theta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{3}} \theta{\left (\tau,\delta \right )} + 6 \left(\frac{\partial^{2}}{\partial \delta^{2}} \theta{\left (\tau,\delta \right )}\right)^{2} + \frac{2 \left(\left(\delta - 1\right)^{2}\right)^{a_{i}}}{\left(\delta - 1\right)^{4}} \left(8 B_{i} a_{i}^{4} - 24 B_{i} a_{i}^{3} + 22 B_{i} a_{i}^{2} - 6 B_{i} a_{i}\right)$$

Derivatives of $\theta$


In [6]:
A_i, beta_i, tau, delta = symbols('A_i, beta_i, tau, delta')
theta = (1-tau) + A_i*((delta-1)**2)**(1/(2*beta_i))
display(Math('\\theta = ' + latex(theta)))

def deriv(idel, itau):
    display(Math(format_deriv('\\theta',itau,idel)
                 + latex( diff(diff(theta, tau, itau), delta, idel)) ))
    #print diff(diff(theta, tau, itau), delta, idel).subs(dict(A_i = 0.7, beta_i = 0.3, tau = 1.3, delta = 0.9))

for n in range(1,5):
    for itau in range(0,n+1):
        deriv(itau, n-itau)


$$\theta = A_{i} \left(\left(\delta - 1\right)^{2}\right)^{\frac{1}{2 \beta_{i}}} - \tau + 1$$
$$\frac{\partial{} \theta}{{\partial \tau}{}} = -1$$
$$\frac{\partial{} \theta}{{}{\partial \delta}} = \frac{A_{i} \left(2 \delta - 2\right) \left(\left(\delta - 1\right)^{2}\right)^{\frac{1}{2 \beta_{i}}}}{2 \beta_{i} \left(\delta - 1\right)^{2}}$$
$$\frac{\partial{^{2}} \theta}{{\partial \tau^{2}}{}} = 0$$
$$\frac{\partial{^{2}} \theta}{{\partial \tau}{\partial \delta}} = 0$$
$$\frac{\partial{^{2}} \theta}{{}{\partial \delta^{2}}} = \frac{A_{i} \left(-1 + \frac{1}{\beta_{i}}\right) \left(\left(\delta - 1\right)^{2}\right)^{\frac{1}{2 \beta_{i}}}}{\beta_{i} \left(\delta - 1\right)^{2}}$$
$$\frac{\partial{^{3}} \theta}{{\partial \tau^{3}}{}} = 0$$
$$\frac{\partial{^{3}} \theta}{{\partial \tau^{2}}{\partial \delta}} = 0$$
$$\frac{\partial{^{3}} \theta}{{\partial \tau}{\partial \delta^{2}}} = 0$$
$$\frac{\partial{^{3}} \theta}{{}{\partial \delta^{3}}} = \frac{A_{i} \left(\left(\delta - 1\right)^{2}\right)^{\frac{1}{2 \beta_{i}}}}{\beta_{i} \left(\delta - 1\right)^{3}} \left(2 - \frac{3}{\beta_{i}} + \frac{1}{\beta_{i}^{2}}\right)$$
$$\frac{\partial{^{4}} \theta}{{\partial \tau^{4}}{}} = 0$$
$$\frac{\partial{^{4}} \theta}{{\partial \tau^{3}}{\partial \delta}} = 0$$
$$\frac{\partial{^{4}} \theta}{{\partial \tau^{2}}{\partial \delta^{2}}} = 0$$
$$\frac{\partial{^{4}} \theta}{{\partial \tau}{\partial \delta^{3}}} = 0$$
$$\frac{\partial{^{4}} \theta}{{}{\partial \delta^{4}}} = \frac{A_{i} \left(\left(\delta - 1\right)^{2}\right)^{\frac{1}{2 \beta_{i}}}}{\beta_{i} \left(\delta - 1\right)^{4}} \left(-6 + \frac{11}{\beta_{i}} - \frac{6}{\beta_{i}^{2}} + \frac{1}{\beta_{i}^{3}}\right)$$

Derivatives of $\psi$


In [8]:
C_i, D_i, tau, delta = symbols('C_i, D_i, tau, delta')
psi = exp( -C_i*(delta-1)**2 -D_i*(tau-1)**2)
display(Math('\\psi = ' + latex(psi)))

def deriv(idel, itau):
    display(Math(format_deriv('\\psi',itau, idel)
                 + latex( diff(diff(psi, tau, itau), delta, idel)).replace(latex(psi),'\psi') ))
    #print diff(diff(psi, tau, itau), delta, idel).subs(dict(C_i = 10, D_i = 275, tau= 1.3, delta = 0.9))

for n in range(1,5):
    for itau in range(0,n+1):
        deriv(itau, n-itau)


$$\psi = e^{- C_{i} \left(\delta - 1\right)^{2} - D_{i} \left(\tau - 1\right)^{2}}$$
$$\frac{\partial{} \psi}{{\partial \tau}{}} = - D_{i} \left(2 \tau - 2\right) \psi$$
$$\frac{\partial{} \psi}{{}{\partial \delta}} = - C_{i} \left(2 \delta - 2\right) \psi$$
$$\frac{\partial{^{2}} \psi}{{\partial \tau^{2}}{}} = 2 D_{i} \left(2 D_{i} \left(\tau - 1\right)^{2} - 1\right) \psi$$
$$\frac{\partial{^{2}} \psi}{{\partial \tau}{\partial \delta}} = C_{i} D_{i} \left(2 \delta - 2\right) \left(2 \tau - 2\right) \psi$$
$$\frac{\partial{^{2}} \psi}{{}{\partial \delta^{2}}} = 2 C_{i} \left(2 C_{i} \left(\delta - 1\right)^{2} - 1\right) \psi$$
$$\frac{\partial{^{3}} \psi}{{\partial \tau^{3}}{}} = 4 D_{i}^{2} \left(\tau - 1\right) \left(- 2 D_{i} \left(\tau - 1\right)^{2} + 3\right) \psi$$
$$\frac{\partial{^{3}} \psi}{{\partial \tau^{2}}{\partial \delta}} = - 2 C_{i} D_{i} \left(2 \delta - 2\right) \left(2 D_{i} \left(\tau - 1\right)^{2} - 1\right) \psi$$
$$\frac{\partial{^{3}} \psi}{{\partial \tau}{\partial \delta^{2}}} = 4 C_{i} D_{i} \left(\tau - 1\right) \left(- 2 C_{i} \left(\delta - 1\right)^{2} + 1\right) \psi$$
$$\frac{\partial{^{3}} \psi}{{}{\partial \delta^{3}}} = 4 C_{i}^{2} \left(\delta - 1\right) \left(- 2 C_{i} \left(\delta - 1\right)^{2} + 3\right) \psi$$
$$\frac{\partial{^{4}} \psi}{{\partial \tau^{4}}{}} = 4 D_{i}^{2} \left(4 D_{i}^{2} \left(\tau - 1\right)^{4} - 12 D_{i} \left(\tau - 1\right)^{2} + 3\right) \psi$$
$$\frac{\partial{^{4}} \psi}{{\partial \tau^{3}}{\partial \delta}} = - 4 C_{i} D_{i}^{2} \left(2 \delta - 2\right) \left(\tau - 1\right) \left(- 2 D_{i} \left(\tau - 1\right)^{2} + 3\right) \psi$$
$$\frac{\partial{^{4}} \psi}{{\partial \tau^{2}}{\partial \delta^{2}}} = 4 C_{i} D_{i} \left(2 C_{i} \left(\delta - 1\right)^{2} - 1\right) \left(2 D_{i} \left(\tau - 1\right)^{2} - 1\right) \psi$$
$$\frac{\partial{^{4}} \psi}{{\partial \tau}{\partial \delta^{3}}} = 8 C_{i}^{2} D_{i} \left(\delta - 1\right) \left(\tau - 1\right) \left(2 C_{i} \left(\delta - 1\right)^{2} - 3\right) \psi$$
$$\frac{\partial{^{4}} \psi}{{}{\partial \delta^{4}}} = 4 C_{i}^{2} \left(4 C_{i}^{2} \left(\delta - 1\right)^{4} - 12 C_{i} \left(\delta - 1\right)^{2} + 3\right) \psi$$

Derivatives of $\alpha_r$


In [9]:
n_i, tau, delta = symbols('n_i, tau, delta')
Delta_bi = symbols('Delta_bi', cls=Function)(tau, delta)
psi = symbols('psi', cls=Function)(tau, delta)
alphar = n_i*delta*Delta_bi*psi
display(Math('\\alpha^{{r}}_{{NA,i}} = ' 
             + latex(alphar).replace(latex(Delta_bi),'\Delta^{b_i}')))

def collector(a):
    return collect(a, Delta_bi)
    
def deriv(idel, itau):
    dd = diff(diff(alphar, tau, itau), delta, idel)
    dd = simplify(dd)
    dd = use(dd, expand, 2)
    display(Math(format_deriv('\\alpha^{{r}}_{{NA,i}}',itau,idel)
                 + latex(dd).replace(latex(Delta_bi),'\Delta^{b_i}') ))

for n in range(1,5):
    for itau in range(0,n+1):
        deriv(itau, n-itau)


$$\alpha^{{r}}_{{NA,i}} = \delta n_{i} \Delta^{b_i} \psi{\left (\tau,\delta \right )}$$
$$\frac{\partial{} \alpha^{{r}}_{{NA,i}}}{{\partial \tau}{}} = \delta n_{i} \left(\Delta^{b_i} \frac{\partial}{\partial \tau} \psi{\left (\tau,\delta \right )} + \psi{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \Delta^{b_i}\right)$$
$$\frac{\partial{} \alpha^{{r}}_{{NA,i}}}{{}{\partial \delta}} = n_{i} \left(\delta \Delta^{b_i} \frac{\partial}{\partial \delta} \psi{\left (\tau,\delta \right )} + \delta \psi{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta^{b_i} + \Delta^{b_i} \psi{\left (\tau,\delta \right )}\right)$$
$$\frac{\partial{^{2}} \alpha^{{r}}_{{NA,i}}}{{\partial \tau^{2}}{}} = \delta n_{i} \left(\Delta^{b_i} \frac{\partial^{2}}{\partial \tau^{2}} \psi{\left (\tau,\delta \right )} + \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \Delta^{b_i} + 2 \frac{\partial}{\partial \tau} \Delta^{b_i} \frac{\partial}{\partial \tau} \psi{\left (\tau,\delta \right )}\right)$$
$$\frac{\partial{^{2}} \alpha^{{r}}_{{NA,i}}}{{\partial \tau}{\partial \delta}} = n_{i} \left(\delta \Delta^{b_i} \frac{\partial^{2}}{\partial \delta\partial \tau} \psi{\left (\tau,\delta \right )} + \delta \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta^{b_i} + \delta \frac{\partial}{\partial \delta} \Delta^{b_i} \frac{\partial}{\partial \tau} \psi{\left (\tau,\delta \right )} + \delta \frac{\partial}{\partial \tau} \Delta^{b_i} \frac{\partial}{\partial \delta} \psi{\left (\tau,\delta \right )} + \Delta^{b_i} \frac{\partial}{\partial \tau} \psi{\left (\tau,\delta \right )} + \psi{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \Delta^{b_i}\right)$$
$$\frac{\partial{^{2}} \alpha^{{r}}_{{NA,i}}}{{}{\partial \delta^{2}}} = n_{i} \left(\delta \Delta^{b_i} \frac{\partial^{2}}{\partial \delta^{2}} \psi{\left (\tau,\delta \right )} + \delta \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \Delta^{b_i} + 2 \delta \frac{\partial}{\partial \delta} \Delta^{b_i} \frac{\partial}{\partial \delta} \psi{\left (\tau,\delta \right )} + 2 \Delta^{b_i} \frac{\partial}{\partial \delta} \psi{\left (\tau,\delta \right )} + 2 \psi{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta^{b_i}\right)$$
$$\frac{\partial{^{3}} \alpha^{{r}}_{{NA,i}}}{{\partial \tau^{3}}{}} = \delta n_{i} \left(\Delta^{b_i} \frac{\partial^{3}}{\partial \tau^{3}} \psi{\left (\tau,\delta \right )} + \psi{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \tau^{3}} \Delta^{b_i} + 3 \frac{\partial}{\partial \tau} \Delta^{b_i} \frac{\partial^{2}}{\partial \tau^{2}} \psi{\left (\tau,\delta \right )} + 3 \frac{\partial}{\partial \tau} \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \Delta^{b_i}\right)$$
$$\frac{\partial{^{3}} \alpha^{{r}}_{{NA,i}}}{{\partial \tau^{2}}{\partial \delta}} = n_{i} \left(\delta \Delta^{b_i} \frac{\partial^{3}}{\partial \delta\partial \tau^{2}} \psi{\left (\tau,\delta \right )} + \delta \psi{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta\partial \tau^{2}} \Delta^{b_i} + \delta \frac{\partial}{\partial \delta} \Delta^{b_i} \frac{\partial^{2}}{\partial \tau^{2}} \psi{\left (\tau,\delta \right )} + 2 \delta \frac{\partial}{\partial \tau} \Delta^{b_i} \frac{\partial^{2}}{\partial \delta\partial \tau} \psi{\left (\tau,\delta \right )} + \delta \frac{\partial}{\partial \delta} \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \Delta^{b_i} + 2 \delta \frac{\partial}{\partial \tau} \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta^{b_i} + \Delta^{b_i} \frac{\partial^{2}}{\partial \tau^{2}} \psi{\left (\tau,\delta \right )} + \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \Delta^{b_i} + 2 \frac{\partial}{\partial \tau} \Delta^{b_i} \frac{\partial}{\partial \tau} \psi{\left (\tau,\delta \right )}\right)$$
$$\frac{\partial{^{3}} \alpha^{{r}}_{{NA,i}}}{{\partial \tau}{\partial \delta^{2}}} = n_{i} \left(\delta \Delta^{b_i} \frac{\partial^{3}}{\partial \delta^{2}\partial \tau} \psi{\left (\tau,\delta \right )} + \delta \psi{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{2}\partial \tau} \Delta^{b_i} + 2 \delta \frac{\partial}{\partial \delta} \Delta^{b_i} \frac{\partial^{2}}{\partial \delta\partial \tau} \psi{\left (\tau,\delta \right )} + \delta \frac{\partial}{\partial \tau} \Delta^{b_i} \frac{\partial^{2}}{\partial \delta^{2}} \psi{\left (\tau,\delta \right )} + 2 \delta \frac{\partial}{\partial \delta} \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta^{b_i} + \delta \frac{\partial}{\partial \tau} \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \Delta^{b_i} + 2 \Delta^{b_i} \frac{\partial^{2}}{\partial \delta\partial \tau} \psi{\left (\tau,\delta \right )} + 2 \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta^{b_i} + 2 \frac{\partial}{\partial \delta} \Delta^{b_i} \frac{\partial}{\partial \tau} \psi{\left (\tau,\delta \right )} + 2 \frac{\partial}{\partial \tau} \Delta^{b_i} \frac{\partial}{\partial \delta} \psi{\left (\tau,\delta \right )}\right)$$
$$\frac{\partial{^{3}} \alpha^{{r}}_{{NA,i}}}{{}{\partial \delta^{3}}} = n_{i} \left(\delta \Delta^{b_i} \frac{\partial^{3}}{\partial \delta^{3}} \psi{\left (\tau,\delta \right )} + \delta \psi{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{3}} \Delta^{b_i} + 3 \delta \frac{\partial}{\partial \delta} \Delta^{b_i} \frac{\partial^{2}}{\partial \delta^{2}} \psi{\left (\tau,\delta \right )} + 3 \delta \frac{\partial}{\partial \delta} \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \Delta^{b_i} + 3 \Delta^{b_i} \frac{\partial^{2}}{\partial \delta^{2}} \psi{\left (\tau,\delta \right )} + 3 \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \Delta^{b_i} + 6 \frac{\partial}{\partial \delta} \Delta^{b_i} \frac{\partial}{\partial \delta} \psi{\left (\tau,\delta \right )}\right)$$
$$\frac{\partial{^{4}} \alpha^{{r}}_{{NA,i}}}{{\partial \tau^{4}}{}} = \delta n_{i} \left(\Delta^{b_i} \frac{\partial^{4}}{\partial \tau^{4}} \psi{\left (\tau,\delta \right )} + \psi{\left (\tau,\delta \right )} \frac{\partial^{4}}{\partial \tau^{4}} \Delta^{b_i} + 4 \frac{\partial}{\partial \tau} \Delta^{b_i} \frac{\partial^{3}}{\partial \tau^{3}} \psi{\left (\tau,\delta \right )} + 4 \frac{\partial}{\partial \tau} \psi{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \tau^{3}} \Delta^{b_i} + 6 \frac{\partial^{2}}{\partial \tau^{2}} \Delta^{b_i} \frac{\partial^{2}}{\partial \tau^{2}} \psi{\left (\tau,\delta \right )}\right)$$
$$\frac{\partial{^{4}} \alpha^{{r}}_{{NA,i}}}{{\partial \tau^{3}}{\partial \delta}} = n_{i} \left(\delta \Delta^{b_i} \frac{\partial^{4}}{\partial \delta\partial \tau^{3}} \psi{\left (\tau,\delta \right )} + \delta \psi{\left (\tau,\delta \right )} \frac{\partial^{4}}{\partial \delta\partial \tau^{3}} \Delta^{b_i} + \delta \frac{\partial}{\partial \delta} \Delta^{b_i} \frac{\partial^{3}}{\partial \tau^{3}} \psi{\left (\tau,\delta \right )} + 3 \delta \frac{\partial}{\partial \tau} \Delta^{b_i} \frac{\partial^{3}}{\partial \delta\partial \tau^{2}} \psi{\left (\tau,\delta \right )} + \delta \frac{\partial}{\partial \delta} \psi{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \tau^{3}} \Delta^{b_i} + 3 \delta \frac{\partial}{\partial \tau} \psi{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta\partial \tau^{2}} \Delta^{b_i} + 3 \delta \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta^{b_i} \frac{\partial^{2}}{\partial \tau^{2}} \psi{\left (\tau,\delta \right )} + 3 \delta \frac{\partial^{2}}{\partial \tau^{2}} \Delta^{b_i} \frac{\partial^{2}}{\partial \delta\partial \tau} \psi{\left (\tau,\delta \right )} + \Delta^{b_i} \frac{\partial^{3}}{\partial \tau^{3}} \psi{\left (\tau,\delta \right )} + \psi{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \tau^{3}} \Delta^{b_i} + 3 \frac{\partial}{\partial \tau} \Delta^{b_i} \frac{\partial^{2}}{\partial \tau^{2}} \psi{\left (\tau,\delta \right )} + 3 \frac{\partial}{\partial \tau} \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \Delta^{b_i}\right)$$
$$\frac{\partial{^{4}} \alpha^{{r}}_{{NA,i}}}{{\partial \tau^{2}}{\partial \delta^{2}}} = n_{i} \left(\delta \Delta^{b_i} \frac{\partial^{4}}{\partial \delta^{2}\partial \tau^{2}} \psi{\left (\tau,\delta \right )} + \delta \psi{\left (\tau,\delta \right )} \frac{\partial^{4}}{\partial \delta^{2}\partial \tau^{2}} \Delta^{b_i} + 2 \delta \frac{\partial}{\partial \delta} \Delta^{b_i} \frac{\partial^{3}}{\partial \delta\partial \tau^{2}} \psi{\left (\tau,\delta \right )} + 2 \delta \frac{\partial}{\partial \tau} \Delta^{b_i} \frac{\partial^{3}}{\partial \delta^{2}\partial \tau} \psi{\left (\tau,\delta \right )} + 2 \delta \frac{\partial}{\partial \delta} \psi{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta\partial \tau^{2}} \Delta^{b_i} + 2 \delta \frac{\partial}{\partial \tau} \psi{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{2}\partial \tau} \Delta^{b_i} + \delta \frac{\partial^{2}}{\partial \delta^{2}} \Delta^{b_i} \frac{\partial^{2}}{\partial \tau^{2}} \psi{\left (\tau,\delta \right )} + 4 \delta \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta^{b_i} \frac{\partial^{2}}{\partial \delta\partial \tau} \psi{\left (\tau,\delta \right )} + \delta \frac{\partial^{2}}{\partial \tau^{2}} \Delta^{b_i} \frac{\partial^{2}}{\partial \delta^{2}} \psi{\left (\tau,\delta \right )} + 2 \Delta^{b_i} \frac{\partial^{3}}{\partial \delta\partial \tau^{2}} \psi{\left (\tau,\delta \right )} + 2 \psi{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta\partial \tau^{2}} \Delta^{b_i} + 2 \frac{\partial}{\partial \delta} \Delta^{b_i} \frac{\partial^{2}}{\partial \tau^{2}} \psi{\left (\tau,\delta \right )} + 4 \frac{\partial}{\partial \tau} \Delta^{b_i} \frac{\partial^{2}}{\partial \delta\partial \tau} \psi{\left (\tau,\delta \right )} + 2 \frac{\partial}{\partial \delta} \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \Delta^{b_i} + 4 \frac{\partial}{\partial \tau} \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta^{b_i}\right)$$
$$\frac{\partial{^{4}} \alpha^{{r}}_{{NA,i}}}{{\partial \tau}{\partial \delta^{3}}} = n_{i} \left(\delta \Delta^{b_i} \frac{\partial^{4}}{\partial \delta^{3}\partial \tau} \psi{\left (\tau,\delta \right )} + \delta \psi{\left (\tau,\delta \right )} \frac{\partial^{4}}{\partial \delta^{3}\partial \tau} \Delta^{b_i} + 3 \delta \frac{\partial}{\partial \delta} \Delta^{b_i} \frac{\partial^{3}}{\partial \delta^{2}\partial \tau} \psi{\left (\tau,\delta \right )} + \delta \frac{\partial}{\partial \tau} \Delta^{b_i} \frac{\partial^{3}}{\partial \delta^{3}} \psi{\left (\tau,\delta \right )} + 3 \delta \frac{\partial}{\partial \delta} \psi{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{2}\partial \tau} \Delta^{b_i} + \delta \frac{\partial}{\partial \tau} \psi{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{3}} \Delta^{b_i} + 3 \delta \frac{\partial^{2}}{\partial \delta^{2}} \Delta^{b_i} \frac{\partial^{2}}{\partial \delta\partial \tau} \psi{\left (\tau,\delta \right )} + 3 \delta \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta^{b_i} \frac{\partial^{2}}{\partial \delta^{2}} \psi{\left (\tau,\delta \right )} + 3 \Delta^{b_i} \frac{\partial^{3}}{\partial \delta^{2}\partial \tau} \psi{\left (\tau,\delta \right )} + 3 \psi{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{2}\partial \tau} \Delta^{b_i} + 6 \frac{\partial}{\partial \delta} \Delta^{b_i} \frac{\partial^{2}}{\partial \delta\partial \tau} \psi{\left (\tau,\delta \right )} + 3 \frac{\partial}{\partial \tau} \Delta^{b_i} \frac{\partial^{2}}{\partial \delta^{2}} \psi{\left (\tau,\delta \right )} + 6 \frac{\partial}{\partial \delta} \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta^{b_i} + 3 \frac{\partial}{\partial \tau} \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \Delta^{b_i}\right)$$
$$\frac{\partial{^{4}} \alpha^{{r}}_{{NA,i}}}{{}{\partial \delta^{4}}} = n_{i} \left(\delta \Delta^{b_i} \frac{\partial^{4}}{\partial \delta^{4}} \psi{\left (\tau,\delta \right )} + \delta \psi{\left (\tau,\delta \right )} \frac{\partial^{4}}{\partial \delta^{4}} \Delta^{b_i} + 4 \delta \frac{\partial}{\partial \delta} \Delta^{b_i} \frac{\partial^{3}}{\partial \delta^{3}} \psi{\left (\tau,\delta \right )} + 4 \delta \frac{\partial}{\partial \delta} \psi{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{3}} \Delta^{b_i} + 6 \delta \frac{\partial^{2}}{\partial \delta^{2}} \Delta^{b_i} \frac{\partial^{2}}{\partial \delta^{2}} \psi{\left (\tau,\delta \right )} + 4 \Delta^{b_i} \frac{\partial^{3}}{\partial \delta^{3}} \psi{\left (\tau,\delta \right )} + 4 \psi{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{3}} \Delta^{b_i} + 12 \frac{\partial}{\partial \delta} \Delta^{b_i} \frac{\partial^{2}}{\partial \delta^{2}} \psi{\left (\tau,\delta \right )} + 12 \frac{\partial}{\partial \delta} \psi{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \Delta^{b_i}\right)$$

Derivatives of $\Delta^{b_i}$


In [10]:
b_i, tau, delta = symbols('b_i, tau, delta')
Delta = symbols('Delta', cls=Function)(tau, delta)

#c_i, beta_i, a_i, d_i = symbols('c_i, beta_i, a_i, d_i')
#_theta = (1-tau) + c_i*((delta-1)**2)**(1/(2*beta_i))
#_Delta = _theta**2+d_i*((delta-1)**2)**a_i
#print _Delta

def deriv(idel, itau):
    dd = diff(diff(Delta**b_i, tau, itau), delta, idel)
    dd = use(dd, simplify, 2)
    dd = use(dd, factor, 2)
    
    display(Math(format_deriv('\\Delta^{{b_i}}', itau, idel)
                 + latex(simplify(dd)) ))
    
    #el = diff(diff(Delta**b_i, tau, itau), delta, idel)
    #args = dict(c_i = 0.7, beta_i = 0.3, d_i = 0.3, a_i = 3.5, b_i = 0.875, tau = 1.3, delta = 0.9) 
    #for n in range(1,5):
    #    for _itau in range(0,n+1):
    #        s = diff(diff(_Delta, tau, _itau), delta, n-_itau).subs(args)
    #        el = el.replace(diff(diff(Delta, tau, _itau), delta, n-_itau), s)
    #el = el.subs(Delta, _Delta)
    #print el.subs(args).evalf()

for n in range(1,5):
    for itau in range(0,n+1):
        deriv(itau, n-itau)


$$\frac{\partial{} \Delta^{{b_i}}}{{\partial \tau}{}} = b_{i} \Delta^{b_{i} - 1}{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}$$
$$\frac{\partial{} \Delta^{{b_i}}}{{}{\partial \delta}} = b_{i} \Delta^{b_{i} - 1}{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )}$$
$$\frac{\partial{^{2}} \Delta^{{b_i}}}{{\partial \tau^{2}}{}} = b_{i} \left(b_{i} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2} + \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} - \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2}\right) \Delta^{b_{i} - 2}{\left (\tau,\delta \right )}$$
$$\frac{\partial{^{2}} \Delta^{{b_i}}}{{\partial \tau}{\partial \delta}} = \frac{b_{i}}{\Delta^{3}{\left (\tau,\delta \right )}} \left(\left(b_{i} - 1\right) \Delta^{b_{i} + 1}{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} + \Delta^{b_{i} + 2}{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )}\right)$$
$$\frac{\partial{^{2}} \Delta^{{b_i}}}{{}{\partial \delta^{2}}} = b_{i} \left(b_{i} \left(\frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )}\right)^{2} + \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \Delta{\left (\tau,\delta \right )} - \left(\frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )}\right)^{2}\right) \Delta^{b_{i} - 2}{\left (\tau,\delta \right )}$$
$$\frac{\partial{^{3}} \Delta^{{b_i}}}{{\partial \tau^{3}}{}} = b_{i} \left(3 \left(b_{i} - 1\right) \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} + \left(b_{i}^{2} - 3 b_{i} + 2\right) \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{3} + \Delta^{2}{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \tau^{3}} \Delta{\left (\tau,\delta \right )}\right) \Delta^{b_{i} - 3}{\left (\tau,\delta \right )}$$
$$\frac{\partial{^{3}} \Delta^{{b_i}}}{{\partial \tau^{2}}{\partial \delta}} = b_{i} \left(b_{i}^{2} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2} + b_{i} \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} + 2 b_{i} \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )} - 3 b_{i} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2} + \Delta^{2}{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} - \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} - 2 \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )} + 2 \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2}\right) \Delta^{b_{i} - 3}{\left (\tau,\delta \right )}$$
$$\frac{\partial{^{3}} \Delta^{{b_i}}}{{\partial \tau}{\partial \delta^{2}}} = b_{i} \left(\left(b_{i}^{2} - 3 b_{i} + 2\right) \left(\frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )}\right)^{2} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} + \left(2 b_{i} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )} + b_{i} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \Delta{\left (\tau,\delta \right )} - 2 \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )} - \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \Delta{\left (\tau,\delta \right )}\right) \Delta{\left (\tau,\delta \right )} + \Delta^{2}{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{2}\partial \tau} \Delta{\left (\tau,\delta \right )}\right) \Delta^{b_{i} - 3}{\left (\tau,\delta \right )}$$
$$\frac{\partial{^{3}} \Delta^{{b_i}}}{{}{\partial \delta^{3}}} = b_{i} \left(3 \left(b_{i} - 1\right) \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \Delta{\left (\tau,\delta \right )} + \left(b_{i}^{2} - 3 b_{i} + 2\right) \left(\frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )}\right)^{3} + \Delta^{2}{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{3}} \Delta{\left (\tau,\delta \right )}\right) \Delta^{b_{i} - 3}{\left (\tau,\delta \right )}$$
$$\frac{\partial{^{4}} \Delta^{{b_i}}}{{\partial \tau^{4}}{}} = b_{i} \left(6 \left(b_{i}^{2} - 3 b_{i} + 2\right) \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2} \frac{\partial^{2}}{\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} + \left(b_{i}^{3} - 6 b_{i}^{2} + 11 b_{i} - 6\right) \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{4} + \left(4 b_{i} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \tau^{3}} \Delta{\left (\tau,\delta \right )} + 3 b_{i} \left(\frac{\partial^{2}}{\partial \tau^{2}} \Delta{\left (\tau,\delta \right )}\right)^{2} - 4 \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \tau^{3}} \Delta{\left (\tau,\delta \right )} - 3 \left(\frac{\partial^{2}}{\partial \tau^{2}} \Delta{\left (\tau,\delta \right )}\right)^{2}\right) \Delta^{2}{\left (\tau,\delta \right )} + \Delta^{3}{\left (\tau,\delta \right )} \frac{\partial^{4}}{\partial \tau^{4}} \Delta{\left (\tau,\delta \right )}\right) \Delta^{b_{i} - 4}{\left (\tau,\delta \right )}$$
$$\frac{\partial{^{4}} \Delta^{{b_i}}}{{\partial \tau^{3}}{\partial \delta}} = b_{i} \left(b_{i}^{3} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{3} + 3 b_{i}^{2} \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} + 3 b_{i}^{2} \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )} - 6 b_{i}^{2} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{3} + b_{i} \Delta^{2}{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \tau^{3}} \Delta{\left (\tau,\delta \right )} + 3 b_{i} \Delta^{2}{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} + 3 b_{i} \Delta^{2}{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} - 9 b_{i} \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} - 9 b_{i} \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )} + 11 b_{i} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{3} + \Delta^{3}{\left (\tau,\delta \right )} \frac{\partial^{4}}{\partial \delta\partial \tau^{3}} \Delta{\left (\tau,\delta \right )} - \Delta^{2}{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \tau^{3}} \Delta{\left (\tau,\delta \right )} - 3 \Delta^{2}{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} - 3 \Delta^{2}{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} + 6 \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} + 6 \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )} - 6 \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{3}\right) \Delta^{b_{i} - 4}{\left (\tau,\delta \right )}$$
$$\frac{\partial{^{4}} \Delta^{{b_i}}}{{\partial \tau^{2}}{\partial \delta^{2}}} = b_{i} \left(b_{i}^{3} \left(\frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )}\right)^{2} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2} + b_{i}^{2} \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )}\right)^{2} \frac{\partial^{2}}{\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} + 4 b_{i}^{2} \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )} + b_{i}^{2} \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2} \frac{\partial^{2}}{\partial \delta^{2}} \Delta{\left (\tau,\delta \right )} - 6 b_{i}^{2} \left(\frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )}\right)^{2} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2} + 2 b_{i} \Delta^{2}{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} + 2 b_{i} \Delta^{2}{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{2}\partial \tau} \Delta{\left (\tau,\delta \right )} + b_{i} \Delta^{2}{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} + 2 b_{i} \Delta^{2}{\left (\tau,\delta \right )} \left(\frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2} - 3 b_{i} \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )}\right)^{2} \frac{\partial^{2}}{\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} - 12 b_{i} \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )} - 3 b_{i} \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2} \frac{\partial^{2}}{\partial \delta^{2}} \Delta{\left (\tau,\delta \right )} + 11 b_{i} \left(\frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )}\right)^{2} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2} + \Delta^{3}{\left (\tau,\delta \right )} \frac{\partial^{4}}{\partial \delta^{2}\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} - 2 \Delta^{2}{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} - 2 \Delta^{2}{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{2}\partial \tau} \Delta{\left (\tau,\delta \right )} - \Delta^{2}{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} - 2 \Delta^{2}{\left (\tau,\delta \right )} \left(\frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2} + 2 \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )}\right)^{2} \frac{\partial^{2}}{\partial \tau^{2}} \Delta{\left (\tau,\delta \right )} + 8 \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )} + 2 \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2} \frac{\partial^{2}}{\partial \delta^{2}} \Delta{\left (\tau,\delta \right )} - 6 \left(\frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )}\right)^{2} \left(\frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )}\right)^{2}\right) \Delta^{b_{i} - 4}{\left (\tau,\delta \right )}$$
$$\frac{\partial{^{4}} \Delta^{{b_i}}}{{\partial \tau}{\partial \delta^{3}}} = b_{i} \left(\left(b_{i}^{3} - 6 b_{i}^{2} + 11 b_{i} - 6\right) \left(\frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )}\right)^{3} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} + \left(3 b_{i} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{2}\partial \tau} \Delta{\left (\tau,\delta \right )} + b_{i} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{3}} \Delta{\left (\tau,\delta \right )} + 3 b_{i} \frac{\partial^{2}}{\partial \delta^{2}} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )} - 3 \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{2}\partial \tau} \Delta{\left (\tau,\delta \right )} - \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{3}} \Delta{\left (\tau,\delta \right )} - 3 \frac{\partial^{2}}{\partial \delta^{2}} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )}\right) \Delta^{2}{\left (\tau,\delta \right )} + 3 \left(b_{i}^{2} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )} + b_{i}^{2} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \Delta{\left (\tau,\delta \right )} - 3 b_{i} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )} - 3 b_{i} \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \Delta{\left (\tau,\delta \right )} + 2 \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta\partial \tau} \Delta{\left (\tau,\delta \right )} + 2 \frac{\partial}{\partial \tau} \Delta{\left (\tau,\delta \right )} \frac{\partial^{2}}{\partial \delta^{2}} \Delta{\left (\tau,\delta \right )}\right) \Delta{\left (\tau,\delta \right )} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} + \Delta^{3}{\left (\tau,\delta \right )} \frac{\partial^{4}}{\partial \delta^{3}\partial \tau} \Delta{\left (\tau,\delta \right )}\right) \Delta^{b_{i} - 4}{\left (\tau,\delta \right )}$$
$$\frac{\partial{^{4}} \Delta^{{b_i}}}{{}{\partial \delta^{4}}} = b_{i} \left(6 \left(b_{i}^{2} - 3 b_{i} + 2\right) \Delta{\left (\tau,\delta \right )} \left(\frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )}\right)^{2} \frac{\partial^{2}}{\partial \delta^{2}} \Delta{\left (\tau,\delta \right )} + \left(b_{i}^{3} - 6 b_{i}^{2} + 11 b_{i} - 6\right) \left(\frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )}\right)^{4} + \left(4 b_{i} \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{3}} \Delta{\left (\tau,\delta \right )} + 3 b_{i} \left(\frac{\partial^{2}}{\partial \delta^{2}} \Delta{\left (\tau,\delta \right )}\right)^{2} - 4 \frac{\partial}{\partial \delta} \Delta{\left (\tau,\delta \right )} \frac{\partial^{3}}{\partial \delta^{3}} \Delta{\left (\tau,\delta \right )} - 3 \left(\frac{\partial^{2}}{\partial \delta^{2}} \Delta{\left (\tau,\delta \right )}\right)^{2}\right) \Delta^{2}{\left (\tau,\delta \right )} + \Delta^{3}{\left (\tau,\delta \right )} \frac{\partial^{4}}{\partial \delta^{4}} \Delta{\left (\tau,\delta \right )}\right) \Delta^{b_{i} - 4}{\left (\tau,\delta \right )}$$

In [9]: