# Formulas for Higher-Order Derivatives

In general, to find n-th derivative of function `y=f(x)` we need to find all derivatives of previous orders. But sometimes it is possible to obtain expression for n-th derivative that depends on `n` and doesn't contain previous derivatives.

First of all it is easily to extend constant multiple, sum and difference rules.

**Fact**. For functions `f(x)` and `g(x)`, and constant `c` we have that

- `(cf)^((n))=c*f^((n))`;
- `(f+-g)^((n))=f^((n))+-g^((n))`.

Now consider power function `y=x^a`.

We have that `y'=ax^(a-1)`, `y''=a(a-1)x^(a-2)`.

In general, `color(red)((x^a)^((n))=a(a-1)...(a-n+1)x^(a-n))`.

**Example 1 **. Find `y^((7))` if `y=2x^5-5x^10`.

We first use constant multiple and sum rule and then formula for power function.

`y^((7))=(2x^5-5x^10)^((7))=2(x^5)^((7))-5(x^10)^((7))=`

`=2(5*4*3*2*1*0*(-1)*x^(5-7))-5(10*9*8*7*6*5*4*x^(10-7))=-3024000x^3`.

For function `y=a^x` we have that `y'=a^xln(a)`, `y''=a^x(ln(a))^2` and in general `color(green)((a^x)^((n))=a^x(ln(a))^n)`. In particular, `color(blue)((e^x)^((n))=e^x)`.

For function `y=sin(x)` we have that `y'=cos(x)`, `y''=-sin(x)`, `y'''=-cos(x)`, `y^((4))=sin(x)`.

Since `cos(x)=sin(x+pi/2)` then `color(107,32,35)((sin(x))^((n))=sin(x+n pi/2))`.

Similarly, `color(165,42,42)((cos(x))^((n))=cos(x+n pi/2))`.

We saw that constant multiple and sum rules are easily extended for n-th derivative.

It is not a case with product rule.

So, let's see how product rule looks like in the case of higher-order derivatives.

Suppose that function `f(x)` and `g(x)` has finite derivatives up to n-th order.

We have that `(fg)'=f'g+fg'`, `(fg)''=(f'g+fg')'=(f'g)'+(fg')'=(f''g+f'g')+(f'g'+fg'')=f''g+2f'g'+fg''`.

For third derivative we have `(fg)'''=(f''g+2f'g'+fg'')'=(f''g)'+2(f'g')'+(fg'')'=`

`=(f'''g+f''g')+2(f''g'+f'g'')+(f'g''+fg''')=f'''g+3f''g+3f'g''+fg'''`.

We see that these formulas are very similar to the expansion of binom of newton. Just instead of powers here are derivatives. If we denote `f=f^((0))` and `g=g^((0))` then we will obtain Leibniz Formula.

**Leibniz Formula**. `(fg)^((n))=sum_(i=0)^n C_n^i f^((n-i))g^((i))`.

We can extend this case when in product there are more than two functions, but this involves many formulas and calculations fairly complex.

**Example 2**. Find `(x^2cos(x))^((50))`.

Here `g(x)=x^2` and `f(x)=cos(x)`.

We have that, `(f(x))^((k))=cos(x+k pi/2)`. Also `g'(x)=2x`, `g''(x)=2`, `g'''(x)=g^((4))(x)=...=0`.

This means that in Leibniz formula all summands except first three will be equal 0. Thus, `(fg)^((50))=C_50^0 f^((50))g+C_50^1 f^((49))g'+C_50^2 f^((48))g''=`

`=1*cos(x+50 pi/2)*x^2+50*cos(x+49 pi/2)*2x+(50*49)/2 *cos(x+48 pi/2)*2=`

`=-x^2cos(x)-100xsin(x)+2450cos(x)=(2450-x^2)cos(x)-100xsin(x)`.

So, `(x^2cos(x))^((50))=(2450-x^2)cos(x)-100xsin(x)`.