5

Is there a short way to say $f(f(f(f(x))))$?

I know you can use recursion:

$g(x,y)=\begin{cases} f(g(x,y-1)) & \text{if } y > 0, \ \newline x & \text{if } y = 0. \end{cases}$

Mateen Ulhaq
  • 1,211

4 Answers4

11

I personally prefer $f^{\circ n} = f \circ f^{\circ n-1} = \dotsb = \kern{-2em}\underbrace{f \circ \dotsb \circ f}_{n-1\text{ function compositions}}$

kahen
  • 15,760
  • 2
    I should probably remark that the LaTeX above contains a dirty dirty hack: the underbrace construct is manually moved to the left with \kern{-2em}. One can only hope that MathJax picks up on the mathtools package and its \mathclap command. – kahen Oct 27 '10 at 23:49
  • why "n-1 function compositions" instead of n? – Sparr Oct 28 '10 at 03:13
  • I like this one. It seems quite clear. But Sparr is right, should be n – Ross Millikan Oct 28 '10 at 03:38
  • 4
    Because if you want $f^{\circ 2}$, you're composing once: $f \circ f$. So the $n-1$ is counting compositions, not how many times it says $f$. – kahen Oct 28 '10 at 08:30
2

Some will say $f^4(x)$. But it becomes confused with the fourth power or fourth derivative of $f(x)$. I'm not sure what you mean here by "piecewise". To me "piecewise" would be something like a step function:

$f(x)=1$ if $x\gt 0$

$f(x)=0$ if $x\le 0$

Ross Millikan
  • 374,822
  • Ross, that's what Roman numerals are for! $f^{\mathrm{IV}}$ for differentiation. –  Oct 27 '10 at 23:12
  • 1
    @muad Are you being serious? – Mateen Ulhaq Oct 27 '10 at 23:14
  • By "piecewise", I meant g(x,y) { with the second line on top, and the third line on bottom. I think I've figured out how to fix it... – Mateen Ulhaq Oct 27 '10 at 23:17
  • 1
    @muntoo, it's called Lagrange notation. –  Oct 27 '10 at 23:23
  • 4
    @muad Or you could use $f^{(x)}$ for differentiation, right? – Mateen Ulhaq Oct 27 '10 at 23:27
  • @muntoo, yes, I have seen $f^{iv}$ for the derivative, but it has usually been with lower case letters as I have shown. Dunno why. But I have also seen numbers. I think PPJ is right in the comment below that the numbers are usually in parentheses. – Ross Millikan Oct 27 '10 at 23:28
  • @ross Is there any way to tell the difference between $sin^2(x)$ being $sin(sin(x))$ and $(sin(x))^2$? – Mateen Ulhaq Oct 27 '10 at 23:31
  • @muntoo, The rule I said earlier "You can write anything you like" also applies to other people. Indeed, they write any nonsense they like without trying to be consistent or anything. –  Oct 27 '10 at 23:38
  • @muad OK, but is there anyway for me to write it in a way that will help others? (Besides $(sin(x))^2$) – Mateen Ulhaq Oct 27 '10 at 23:39
  • Most commonly $sin^2(x)$ is $(sin(x))^2$ just because that shows up so often. – Ross Millikan Oct 27 '10 at 23:42
  • @ross I must not be being clear... what if $sin$ was replaced by $f$ or $ln$? – Mateen Ulhaq Oct 27 '10 at 23:44
  • 3
    @muntoo then it gets dicier. log gets raised to powers, particularly in analysis of computing efficiency, so $log^n$ (though less likely ln) is probably a power. Other functions less so. You just need to read the definition and be careful. Often you can tell from the context, as if we are iterating it will all be about that. – Ross Millikan Oct 28 '10 at 00:24
  • One think about $f^4$ for the iteration is that it is consistent with $f^{-1}$ for the inverse. This is problematic with $\sin^{-1}$ – Ross Millikan Oct 28 '10 at 03:36
0

You should define it this way:

$$ \begin{eqnarray} \text{iterate}_0(f) &:=& id \\ \text{iterate}_{n + 1}(f) &:=& \text{iterate}_{n}(f) \circ f \end{eqnarray} $$

Then write $\text{iterate}_4(f)(x)$.

0

See "function powers" in Wikipedia "Function composition".

  • 2
    And, incidently, the power notation, $f^4(x)$ is different from the fourth derivative which is $f^{(4)}(x)$, so there shouldn't be any confusion. –  Oct 27 '10 at 23:14
  • 4
    This type of remark (just a pointer to wikipedia or similar) is best as a comment. –  Oct 27 '10 at 23:33