I want to seamlessly connect an unknown parabola to a known sine wave. The equations are:
s(x) = a sin(bx + c)
p(x) = Ax^2 + Bx + C
I want to draw p(x) from 0 to Z and s(x) from Z to Y.
a, b, c, Z and Y are know and I want to calculate A, B and C such as s(Z) = p(Z), s'(Z) = p'(Z) and p(x) is centered on x = 0.
Somebody on StackOverflow suggested
A = ab cos(c) / (2Z)
B = 0
C = a sin(c) - A Z^2
by assuming that I wanted s(0) = p(Z) and s'(0) = p'(Z), but that didn't work for me. See the question linked above for additional information and some visualizations of the functions.
How should I calculate A, B and C?
Note that the center of a parabola is at $x=-\frac{B}{2A}$, so $B=0$.
Now solve in Mathematica and plot the result:
producing the answer:
$$\left\{\left\{A\to \frac{a b \cos (b Z+c)}{2 Z},C\to \frac{1}{2} (2 a \sin (b Z+c)-a b Z \cos (b Z+c))\right\}\right\}$$
(you can reuse $A$ on the $C$ calculation by doing $C\to a \sin (b Z+c)-AZ^2$).
An example plot: