How to (approximately) solve $f(x)^2+f(x)^3=e^x$?

I'm looking for a real-valued function $f$ such that \begin{equation} f(x)^2+f(x)^3=e^x \end{equation} I don't even know if this problem has a solution. I thought of searching for a $n$-degree polynomial approximation of $f$ (let's call it $P_n$) on the interval $[-a,a]$, using the Taylor series of the exponential: \begin{equation} P_n^2+P_n^3=1+x+\frac{1}{2}x^2+\frac{1}{6}x^3+\cdots \end{equation} By considering the truncated series, I can set a relation between the coefficients of $P_n$ and the corresponding coefficients of the powers of $x$ on the right side. The problem is that this setting gives rise to a system of overdetermined non-linear equations, which I don't know how to approach. Any help would be appreciated!

EDIT: I define $f(x)^2$ to be $f(x)\cdot f(x)$, not $f\circ f$.

• I assume $f(x)^2 = f(f(x))$? – Kaynex Feb 13 '17 at 16:00
• I edited the question to clarify. Thank you! – marco trevi Feb 13 '17 at 16:05

The solution of $z^2 + z^3 = t$ that is positive for $t > 0$ can be written as

$$\frac{\left(-8 + 108 t + 12 \sqrt{81 t^2 - 12 t}\right)^{1/3}}{6} + \frac{1}{3 \left( -8 + 108 t + 12 \sqrt{81 t^2 - 12 t}\right)^{1/3}} - \frac{1}{3}$$

However, caution: for $0 < t < 4/27$ the quantity inside the square root is negative, so complex numbers will appear (although the final result should come out real). This is inevitable: see casus irreducibilis.

• Interesting read about the casus irreducibilis! thanks! – marco trevi Feb 13 '17 at 16:32

Can you not directly solve $z^3+z^2-e^x=0$ as a cubic?

Perhaps using a CAS? You might have to restrict your domain.

• I'll wait a few days and then eventually take this as the answer, even if I was hoping for an insight to a more general approach...what if I had $f^a+f^b=e^x$? – marco trevi Feb 13 '17 at 16:23
• I doubt that will make $f(x)$ polynomial, but it will give $f(x).$ You probably want $x^3+x^2$ instead of $z^3+z^2$ – Ross Millikan Feb 13 '17 at 20:38
• @RossMillikan no it certainly isn't a polynomial (see Robert's answer below). I think I do want $z^3+z^2$, no? – JP McCarthy Feb 14 '17 at 8:18
• @RossMillikan ... so that $f(x)=z$. – JP McCarthy Feb 14 '17 at 8:27