Find $a\in\mathbb{R}, a\neq 0$ such that the parabolas of the functions $f$ and $g$ are tangent. 
Find $a\in\mathbb{R}, a\neq 0$ such that the parabolas of the functions $f$ and $g$ are tangent.

$f_a(x)=ax^2-(a+2)x-1$.
$g_a(x)=x^2-x-a$.
At first what I tried is find their derivative and just make them equal, but it's nowhere near the good answer...
What I tried: 
since they must be tangent I thought their derivative should be equal so we have:
$f_a'(x)=2ax-(a+2)$ and $g_a'(x)=2x-1$ by making them equalling we get $a = 1$ and $a = -1$ at the same time... which is completely wrong (that's why I didn't added this).
Following B.Metha's advice we have:
$f_a(x) - g_a(x) = (a-1)x^2-(a+1)x+a-1.$ 
 A: If $a\in\mathbb R$, then the parabolas are tangent if and only if they have one and only one point in common. So, when is it true that the equation$$ax^2-(a+2)x-1=x^2-x-a$$has one and only one solution? That's when the discriminant of $(a-1)x^2-(a+1)x+a-1$ is $0$. That happens if and only if $a=\frac13$ or $a=3$.
A: The answer by José Carlos Santos is (as of now) factually correct but arguably very incomplete because it relies on some fact that only holds for parabolas, without proving it. Here is a much simpler approach:
At the tangency point, we must have equal derivatives, so find out what $x$ must be at that tangency point (in terms of $a$). Also, at the tangency point the two curves must meet, so you can use the found value of $x$ to compare the positions of the two curves at the purported tangency point. That will give you a quadratic equation in $a$.
Along the way, note that you will need to divide by $a-1$, so check that $a$ cannot be $1$ before doing that.
A: $f_a(x)
=ax^2-(a+2)x-1
$,
$g_a(x)=x^2-x-a
$.
Their tangents are
$f_a'(x)
=2ax-(a+2)
$,
$g_a'(x)=2x-1
$.
The tangents have 
the same slope when
$2ax-(a+2)
=2x-1
$
or
$2x(a-1) = a+1
$
or 
$x = \frac{a+1}{2(a-1)}$
(if $a \ne 1$).
If $a=1$ then
$f_a=g_a$
so the curves are identical.
They intersect when
$ax^2-(a+2)x-1
=x^2-x-a
$
or
$(a-1)x^2-(a+1)x+a-1
=0
$.
To have the same slope there,
we must have
$\begin{array}\
0
&=(a-1)x^2-(a+1)x+a-1\\
&=(a-1)(\frac{a+1}{2(a-1)})^2-(a+1)(\frac{a+1}{2(a-1)})+a-1\\
&=\frac{(a+1)^2}{4(a-1)}-\frac{(a+1)^2}{2(a-1)}+a-1\\
&=-\frac{(a+1)^2}{4(a-1)}+a-1\\
&=\frac{4(a-1)^2-(a+1)^2}{4(a-1)}\\
&=\frac{3a^2-10a+3}{4(a-1)}\\
\end{array}
$
so
$3a^2-10a+3
=0$
or
$a
=\dfrac{10\pm\sqrt{100-36}}{6}
=\dfrac{10\pm\sqrt{64}}{6}
=\dfrac{10\pm 8}{6}
=\dfrac{18, 2}{6}
=3, \frac13
$.
For
$a=3$,
$x = \frac{4}{2(2)}
=1
$
and for
$a=\frac13$,
$x
=\frac{\frac43}{2(-\frac23)}
=-1
$.
