1

According to http://mathworld.wolfram.com/SawtoothWave.html the sawtooth function can be plotted as

$$ f(x)=1/2-tan^{-1}[cot\frac{\pi x}{2L}] $$

and they add that $[x]$ is the floor function.

But when I plot $1/tan(cot(pi*floor(x)))$ for simplicity in Kalgebra, this is what I see. What am I missing?

Wolfram's sawtooth

ajeh
  • 117

1 Answers1

2

The formula $tan^{-1}$ does not denote $1/\tan$. It denotes the inverse tangent function, also known as "arctan" (i.e., the function that takes a number $t$ and tells you what angle (between $-\pi/2$ and $\pi/2$) has $t$ as its tangent. Thus $\arctan(1) = \pi/4$, for instance.

Also: if you use "floor", you get the wrong picture; what's probably wanted is the "fractional part", which is $x - floor(x)$. See this desmos plot: enter image description here

As you'll notice (perhaps), I left out the "cot"; that gives as a result an actual "curved" saw-tooth. TO get an ordinary sawtooth, $$ y=\frac{1}{2}-\arctan\left(\cot\left(\pi x\right)\right) $$ suffices, as this plot shows. Note that no "floor" function is needed.

enter image description here

John Hughes
  • 93,729
  • Thanks, makes perfect sense that $arctan()$ works, but using $tan^{-1}$ to denote $arctan$ sounds like a diabolical trolling to me. Who on Earth came up with that practice? I never heard of using that in over 40 years of doing math. – ajeh Oct 28 '17 at 17:00
  • To be honest...writing $f^{-1}$ for the inverse-function of $f$ rather than the multiplicative inverse of $f$ is pretty widespread. It is, after all, an inverse for a different composition rule. To indicate the reciprocal of $\tan (x)$, one might write $\tan(x)^{-1}$, but usually folks just write $\cot(x)$, since it's already defined. – John Hughes Oct 28 '17 at 20:29
  • This is 1 more character and twice more characters in Latex. Makes as much sense as lipstick on a pig, but who am I to argue with the lurnEd? – ajeh Oct 30 '17 at 17:29
  • The development of inverse functions and the notation for them does predate LaTeX by a few years; indeed, it probably predates typing. Hence that may not have been the developers' chief consideration. – John Hughes Oct 30 '17 at 21:06