Is there a simple function that can make sin into a line? [$\sin(f(x)) = {2x\over\pi}$ from $0$ to $\pi\over2$]

85 Views Asked by At

I'm currently working on a synth, and I'd like to find an equation that can go from a triangle wave to sine smoothly. In order to do this, I'm trying to find a function which can be put inside sine $(\sin(f(x))$ that will make the output into a straight line from $(0,0)$ to $({\pi\over2}, 1)$.

Unfortunately, my math is a bit rusty at them moment. I could have sworn there was a way to put arcsin, or arccos into sin and have it kind of cancel out the curve, but I can't remember it (or whether or not it was that simple).

Is there any such simple function $f(x)$ that can be put into sin() to result in a flat line from $(0,0)$ to $({\pi\over2}, 1)$? $f(x)$ such that $\sin(f(x)) = {2x\over \pi}$ from $0$ to $\pi\over2$

3

There are 3 best solutions below

0
On BEST ANSWER

The sin function has an inverse $\sin^{-1}(x)$ defined on $-1<x<1$. $$\sin(\sin^{-1}(x)) = x.$$ I'm not sure if this is the answer you were looking for, but you can just scale the inverse sine like $\sin((2/\pi)x)$ so that at $x = \pi/2$, you are still in the range of the inverse sine.

0
On

I feel dumb. It was really easy to solve:

sin(arcsin(2x/pi))

Also, in case anyone was wondering, I found the actual equation I was looking for. I'm trying to make it so a knob can change a curve from sin to a line incrementally, and found a good one for it.

1-(1-2x/pi)^C. At C=1.757 you get a curve for which the integral of the absolute difference between it and sine from 0 to pi/2 of pretty low, which is more than close enough for my case. And then at C=1 you get a straight line. Pretty neat!

0
On

Here my ideas:

  1. Start with differentiating both sides. $$cos(f(x))*f'(x)=1$$ or $f'(x)=\frac{1}{cos(f(x))}$

  2. Integrate. I've used Maple to do it.

    de := diff(f(x), x) = 2/(Pi*cos(f(x)));
                    d              2      
             de := --- f(x) = ------------
                    dx        Pi cos(f(x))
    
    sol := dsolve(de, f(x));
    
                                   /2 (x + _C1)\
               sol := f(x) = arcsin|-----------|
                                   \    Pi     /
    
  3. Checking for result

    sol := dsolve(de, f(x), implicit);
                         1                       
              sol := x - - Pi sin(f(x)) + _C1 = 0
                         2                       
    

    So, for your quest, _C1 = 0. Then your function is $$f(x)=arcsin(\frac{2x}{\pi})$$ enter image description here