How do I draw $\cos^2{(\frac{\pi}{L}x)}$ on the interval $[-L,L]$?

64 Views Asked by At

I tried plotting $\cos^2{(\frac{\pi}{L}x)}$ with a couple of different values for $L$ on my computer to get an intuitive feeling for what the function looks like. I.e:
$L=0.1$ $L=0.1$ $L=2$ $L=2$ $L=10$ $L=10$

What I noticed is that $L$ results plots the same graph as $-L$. But how can I formalize the drawings for all values of $L$? What would be a sufficient way to approach this?

2

There are 2 best solutions below

2
On BEST ANSWER

Define a dimensionless variable, $\textit{e.g.}$ $\xi=x/L$ with $\xi\in[-1,1]$. Therefore all your graphs will fit within this interval whatever $L$ is.

You will have then: $$f(\xi)=\cos^2{(\xi\pi)} \qquad \xi\in[-1,1]$$

0
On

The graphs all have the following properties:
at $x=0$, $\cos^2(\pi x/L)=1$,
at $x=\pm L/2$, $\cos^2(\pi x/L)=0$,
at $x=\pm L$, $\cos^2(\pi x/L)=1$, and the rest is just filled in by periodic continuation.