How can I get a continuous piecewise polynomial curve, with a turning point (not differentiable)?

127 Views Asked by At

I would like to make a curve which has turning point(x,y).

 y= x^2*2 for x<= 0.5

 y= 1-(1-x)^2*2 for x> 0.5

and still have a smooth S-shaped curve, where the slope is continuous on both sides of the turning point.

How can I make the equation as simple and straightforward as possible?

1

There are 1 best solutions below

1
On

Differentiating your first function $y=2x^2$ gives $y'=4x$. Evaluating at $x=1/2$, gives $y'=2$.

Differentiating your second function $y=-2x^2+4x-1$ gives $y'=-4x+4$. Evaluating at $x=1/2$, gives $y'=2$.

You picked a pair of curves whose derivatives are lines and only intersect at the point you have chosen.

Choose simpler functions and pick a point of intersection; check the derivatives.

Edit: There are infinitely many lines that will work. Consider $y=x$ and $y=-x$. They have derivatives 1 and -1 everywhere. They intersect at (0,0). According to what you have said, this is a "turning point."