I am solving a problem which asks to find the equation of a horizontal line which crosses the graph of $$y=x^3-3x+1$$ at three distinct points, such that the two areas bounded by such curves are equal.
I am creating a program for this problem. What I did is to solve for the roots or the points of intersection of the 2 curves (say $a,b,c$) analytically. Suppose the horizontal line takes the form $y=y_p$. The roots are functions of $y_p$ only. Then I used composite Simpson's 3/8 rule to compute for the areas which should be numerically equal. I got $y=1$ as the final answer.
My problem is, as an alternative since analytical formulas for cubic equations is very tedious to code, is it possible to solve for the roots by Newton's method even if $y_p$ is still unknown?