Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

$f(x) = \frac{1}{\cos x}$

$f'(x) = \frac{\sin(x)}{\cos^2(x)}$

$f''(x) = \frac{2\sin^2(x)+\cos^2(x)}{\cos^3(x)}$

$f^{(3)}(x) = \frac{6\sin^3(x)+5\cos^2(x)\sin(x)}{cos^4(x)}$


$f^{(n)}(x) = \frac{ ?}{cos^{n+1}(x)}$

Some of these are easy: Others are not. Why?

share|cite|improve this question
I would recommend editing the title to $f(x) = \frac{1}{\cos x}$ then $f^{(n)}(x)$, and $f^n(x)$ generally denotes $f(f(f(\dots f(f(x))\dots)))$. – Brandon Carter Nov 2 '10 at 17:54
up vote 14 down vote accepted

This is asking for the $n$-th derivative of the secant function. As the derivative of $\sec$ is $\sec\tan$ and that of $\tan$ is $\sec^2=1+\tan^2$ then the $n$-th derivative of $\sec$ is $\sec f_n(\tan)$ where $f_0(t)=1$ and $f_{n+1}(t)=tf_n(t)+(t^2+1)f_n'(t)$.

It's probably too much to hope to find a nice formula for the coefficients of the $f_n$. The constant coefficients of $f_{2m}$ are essentially the Euler numbers.

share|cite|improve this answer

For completeness: the Wolfram Functions site gives a series representation for the $n$-th derivative of the secant:

$$\frac{\mathrm d^n}{\mathrm dx^n}\sec\,x=\sum_{j=0}^\infty \frac{(-1)^j}{(2j-n)!} E_{2j} x^{2j-n}$$

where the $E_{2j}$ are the Euler numbers mentioned in Robin's answer.

There is also a finite double series representation:

$$\frac{\mathrm d^n}{\mathrm dx^n}\sec\,x=(n+1)!\sec\,x \sum _{k=0}^n \sum _{j=0}^{\left\lfloor\frac{k-1}{2}\right\rfloor} \frac{\left((-1)^k 2^{1-k} (k-2 j)^n \sec ^k x\right) \cos\left(\frac{n\pi}{2}+(k-2j)x\right)}{(k+1) j! (k-j)! (n-k)!}$$

As Qiaochu says, there's no good reason to expect that computing higher derivatives of some function is an easy task...

share|cite|improve this answer

That depends on what you mean by "easy." As far as the examples in the .pdf you link to, I claim that the following are true for any reasonable definition of "easy":

  • It is easy to compute the iterated derivatives of powers and logarithms.
  • It is easy to compute the iterated derivatives of solutions to homogeneous linear ODEs.
  • It is easy to compute the iterated derivatives of $x^n f(x)$ if it is easy to compute the iterated derivatives of $f(x)$.
  • It is easy to compute the iterated derivatives $f(x) + g(x)$ if it is easy to compute the iterated derivatives of $f(x)$ and of $g(x)$.

I think that covers all of them. Otherwise, there is no general reason to expect that it should be easy to compute iterated derivatives. Even at $x = 0$ they may define complicated and highly nontrivial sequences, for example the Bernoulli numbers (which are related to this problem).

share|cite|improve this answer

You might want to check out Faa di Bruno's formula:

In your case you have $f(x) = g(h(x))$ where $g(x) = 1/x$ and $h(x) = \cos(x)$. The answer is not simple unfortunately, and involves some combinatorics.

Alternatively, notice $f(x) \cos(x) = 1$, and thus by taking the $m$th derivative of both sides we get

$$ \sum_{k=0}^m {m \choose k} f^{(k)}(x) \left( \frac{d^{m-k}}{dx^{m-k}} \cos(x) \right) = 0 $$

if $m \geq 1$. Thus, you can view the vector $(f(x),f'(x),\dots,f^{(n)}(x))$ as the solution to the system of linear equations above with $m=0,1,\dots,n$. You can invert this matrix numerically, if that if your interest. A closed form might be possible too.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.