Find the set of values of $a\in\mathbb{R}$ such that $f(x)=ax^2+x$ and $g(x)=\ln(1+x)$ have a common tangent in a common point. With $a \in \mathbb{R}$, consider the following two functions:
$$f, g : (-1, \infty) \rightarrow \mathbb{R}$$
$$f(x) = ax^2+x \hspace{2cm} g(x) = \ln(1 + x)$$
I have to find the set of values of $a$ such that the functions $f$ and $g$ have a common tangent in a common point.
I know that to find the common point of $2$ functions, we must solve:
$$f(x) = g(x)$$
And I think that for $2$ functions to have a common tangent, we should have:
$$f'(x) = g'(x)$$
So if we wanted both, meaning a common tangent in a common point, we should solve the system:
$$\begin{cases} f(x) = g(x) \\ f'(x) = g'(x) \end{cases}$$
I am not sure at all if what I've done so far is right or wrong. If my reasoning is incorrect, please tell me. Anyway, I proceeded with the system:
$$\begin{cases} ax^2+x=\ln(1+x)  \\2ax+1=\dfrac{1}{1+x} \end{cases}$$
Since $x \in (-1, \infty)$ we can multiply the second equation by $1+x$.
$$\begin{cases} ax^2+x - \ln(1+x) = 0  \\ 2ax^2+2ax+x+1=0 \end{cases}$$
And I got stuck here. I don't know how to solve that system (provided that what I did so far is right and that this system is really what I have to solve). So, how can I find the values of $a$ such that $f$ and $g$ have a common tangent in a common point?
 A: Check your second equation, i.e. after multiplication by $1+x$, we have:
$$2ax^2 + 2ax + 1 + x = 1, \quad \text{right?}$$
If so, then your second equation is equivalent with:
$$2ax^2 + 2ax + 1 + x = 1 \iff 2ax^2 + 2ax + x = 0,$$
what is easy to solve:
$$x_1=0, x_2=-1-\frac{1}{2a}.$$
Solution $x_1=0$ satisfy your first equation for each $a \in \mathbb{R}$, and solution $x_2=-1-\frac{1}{2a}$ will yield to
$$e^{a^2 - \frac{1}{4a}} = -\frac{1}{2a},$$ 
so it is obvious that we have to exclude $a=0$ fom set of solutions. Next, in our last equation the term on right side is always positive, and the term on left side is a line parallel with $x$ axis, so we have to exclude all values for $a$ that give negative number on the left side of that equation (a line bellow $x$ axis). In other words, only negative values for $a$ will be acceptable for the set of solutions...
A: Solving the second (quadratic) equation you obtain:
$$x_1=-\frac a 2\;\;\;\;\;\;\;\;\;\;\;x_2=-1$$
The second solution must be discarded since $\,\log(1-1)\,$ is not defined.
Substituting the first solution in the other equation, gives the following equation that can be solved only with numerical methods:
$$a=2(1-e^{a(a^2-2)/4})\;\;\;\;\;\;(1)$$
Anyway, the equation $\,(1)\,$ has also the simple solution $\,a=0$.
Actually, $\,f(x)=x\,$ and $\,g(x)=\ln(1+x)\,$ have a common tangent ($f(x)=x$) in $\,x=0$.
