1

I am self-studying through Spivak's Calculus and on the fourth chapter, I got stuck at the plot of a function. It's on the page 61 by the way. The function is this and piecewisely defined;

Spivak piecewise defined function

$$f(1/n) = (-1)^{(n+1)}$$ $$f(-1/n) = (-1)^{(n+1)}$$ and $f(x) = 1$ when $\mid{x}\mid\geq1$

So the interesting part is part of the graph between -1 and 1. Spivak says the function oscillates at each interval such as [1/n+1, 1/n] and each such interval behaves as a linear line segment. So when n = 3, we have f(1/3) = 1 and when n=2 we have f(1/2) = -1 and f behaves like a line in the interval [1/3, 1/2], going from -1 to 1. Spivak says we can even find a line equation for each such interval [1/n+1, 1/n]. But I can't see how this graph is made of straight lines. Can anyone explain this to me?

Alexis Olson
  • 5,414
meguli
  • 640

3 Answers3

3

Take a look at the book again, he said two things: "The graph in figure 18 is made up entirely of straight lines" and "The function $f$ with this graph satisfies [formulas] and is a linear function on each interval [intervals]."

He says that the function in figure $18$ satisfies those formulas, not that these formulas are the function pictured in figure $18$. With the formulas in that page, you can only do - assuming a function $\Bbb{N}\to \Bbb{R}$. If you take $\Bbb{R}\to\Bbb{R}$ or $\Bbb{Q}\to\Bbb{R}$ - some values will have their images in $\Bbb{C}$.

enter image description here

The function in the next page is as follows.

enter image description here

And then he says that we can build explicit formulas for the intervals of those points, that is: We can fill the spaces just as the previous graph and extend the domain to $\Bbb{R}$. A very important idea is to be able to manipulate/construct functions with operations like gluing/distorting/etc any other kinds of known functions. As an example: One remarkable idea is that you can approximate functions such as $\sin(x)$ by polynomials.

Another really interesting example is the gamma function. If you take $f(n)=n!$, this is only defined for $n \in \Bbb{N}$. What if you want to fill the spaces between the points? One answer is the gamma function, another possible answer is the Stirling approximation for factorials:

enter image description here

Red Banana
  • 23,956
  • 20
  • 91
  • 192
2

The author is constructing a piecewise function from a set of points; so what he did was to plot $y$-values of $1$ at the points $x=1,\frac{1}{3},\frac{1}{5} ... $, and $-1$ at $x = \frac{1}{2},\frac{1}{4},\frac{1}{6}...$.

He then joins these points together, and the lines that join them together are linear functions defined differently on each interval $[1/(n+1), 1/n]$, i.e. 'piecewise'.

The exact expression of each piecewise function is not given, but it's easy to find. If I'm not mistaken, the entire point of the illustration is to introduce the concept of piecewise-defined functions.

(For completeness, the formula in the case of $x>0$ should be $f(x) =-1+2\frac{\left(x-\frac{1}{n+1}\right)}{\left(\frac{1}{n}-\frac{1}{n+1}\right)}=-1+2n(n+1)\left(x-\frac{1}{n+1}\right)$ in $[1/(n+1), 1/n]$ when $n$ is odd, and something similar when n is even.)

Ken Wei
  • 1,759
  • So he is just connecting the points at discrete points of n? – meguli Aug 18 '16 at 07:59
  • Yes. The function is defined based on the points that he plotted with the rules he gave for when $x=1/n, n \in \mathbb Z$

    (The exact formula of the piecewise function isn't important; he's just trying to introduce this concept of piecewise functions. On a side note, some crazy functions in analysis are more easily understood when described in words rather than a formal expression -- such as this example, which would certainly be easier to understand and visualise with the joining-points description rather than an exact expression!)

    – Ken Wei Aug 18 '16 at 08:03
  • @meguli: indeed. You could rewrite the function as $f(x):=(-1)^{1+1/x}$, but this is undefined for most $x$. Instead the function is defined by linear interpolation between the points $x=1/n$. –  Aug 18 '16 at 08:04
1

$$f(x)=\cases{4n(2n-1)x-4n+1 & \text{if}\quad \dfrac{1}{2n}< x\leqslant\dfrac{1}{2n-1},\cr 4n+1-4n(2n+1)x& \text{if} \quad\dfrac{1}{2n+1}<x\leqslant\dfrac{1}{2n},}$$for each nonzero integer $n$, with $f(x)=1$ otherwise.

John Bentin
  • 18,454