What goes wrong in my parametric equation for it to produce only a partial rotation of the graph of $f(x)=\cos(x)$?

Solution 1:

By OP's request, a short explanation of the matrix formula: The matrix $$ \begin{pmatrix} \cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta) \end{pmatrix} $$ is the $2 \times 2$ rotation matrix by $\theta$ radians, as can be observed by noting that the first column is the anticlockwise rotation of the unit vector $(1, 0)$ by $\theta$ radians, and the second column is the same transformation of $(0, 1)$. (Draw some triangles with hypotenuse $1$ to convince yourself of this if you haven't played this game before!)

Hence if you take any point/vector $(x, y)$ in the plane and multiply it by this matrix, you get precisely the same point back, only rotated $\theta$ radians anticlockwise.

For our purposes, the points we are interested in are the points $(x, f(x))$ on the graph, so $$ \begin{pmatrix} \cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta) \end{pmatrix} \begin{pmatrix} x \\ f(x) \end{pmatrix} = \begin{pmatrix} x \cos(\theta) - f(x) \sin(\theta) \\ x \sin(\theta) + f(x) \cos(\theta) \end{pmatrix} $$ is exactly the rotation (by $\theta$ radians anticlockwise) of the graph in question.

Specialising at $\theta = \pi/4$ then gives the parametrisation $$ \Bigl( \frac{x - f(x)}{\sqrt{2}}, \frac{x + f(x)}{\sqrt{2}} \Bigr) $$ since $\cos(\pi/4) = \sin(\pi/4) = 1/\sqrt{2}$.