Manipulating $\sin^2(x)$ to fit a specific shape.

73 Views Asked by At

I'm trying to draw a figure using Latex/Tikz, and the best way for me to do this is to define a function mathematically and draw it.

The function I have so far that best fits the picture is $5\sin^2(x) / x$.

I was hoping for some help manipulating it to meet these conditions:

  1. $f(x) = 0$ at $x=0$ and $x = 2\pi$;
  2. $f(x) \not = 0$ at $x = \pi$;
  3. $f(\pi/2) > f(3\pi/2)$.

Outside the limits of $[0,2\pi]$ it doesn't matter how the function behaves.

I've tried adding $\sqrt{x}$ to the end of the equation so that condition 2 is fulfilled, but I can't work out how fulfil the first condition.

Any suggestions?

Thanks.

4

There are 4 best solutions below

0
On

How about adding a term in $\sin x$ to get 3 and a term in $\sin \frac x2$ to get 2?

0
On

Another option is to fit a cubic polynomial: you have four unknowns (the coefficients of the polynomial), so you should be able to solve for them in the system of equations

  • $f(0) = 0$
  • $f(2\pi) = 0$
  • $f'(\pi/2) = 0$
  • $f(\pi/2) = 1$

(you can adjust the last two equations to move the peak from $(\pi/2, 1)$ to anywhere you like)

0
On

these properties don't narrow the selection of functions very much. take for instance $f(x)=x(2\pi-x)^p$ with $p>1$

0
On

Try $$f(x) = 2 \pi x^2 - x^3 = x^2 (2\pi - x).$$ Clearly, $f(0) = f(2\pi) = 0$ and $f(\pi) \neq 0$ with extra $x^2$ in front breaking the symmetry.