[Math] Determine cubic function from 2 roots and a maximum.

algebraic-curvescurves

If I am trying to find a cubic function with 3 real roots, and I know two of them, and one local maximum, is it possible?

Assuming my roots are $0.05$, $0.95$ and $u$, and my local maximum is $(i, j)$.
Since a cubic takes the form $y = ax^3 + bx^2 + cx + d$:

$$ 0 = a(0.05^3) + b(0.05^2) + c(0.05) + d$$
$$ 0 = a(0.95^3) + b(0.95^2) + c(0.95) + d$$
$$ 0 = a(u^3) + b(u^2) + c(u) + d$$

My local maximum is where the derivative = $0$;

$$ 0 = 3ax^2 + 2bx + c $$

Of course, if I could calculate $u$, I could write the cubic in the form:

$$y = (x-0.05)(x-0.95)(x-u)$$

Best Answer

Given any cubic equation

$$f(x) = ax^3 + bx^2 + cx + d = a(x-\alpha)(x-\beta)(x-\gamma)$$

which you know $\alpha$ and $\beta$. If $f(x)$ reaches local maximum at $x_m$ with value $f(x_m) = m$, one has

$$f'(x_m) = 0 \quad\implies\quad \frac{f'(x_m)}{f(x_m)} = 0 \quad\implies\quad \frac{1}{x_m-\alpha}+\frac{1}{x_m-\beta}+\frac{1}{x_m-\gamma} = 0$$ This give us $\quad\displaystyle \gamma = x_m + \frac{1}{\frac{1}{x_m-\alpha} + \frac{1}{x_m-\beta}}$. Once you figure out what $\gamma$ is, then $f(x)$ is given by: $$f(x) = m \frac{(x-\alpha)(x-\beta)(x-\gamma)}{(x_m-\alpha)(x_m-\beta)(x_m-\gamma)}$$