Answer
$x=-2+\sqrt{80}$
Work Step by Step
The area of a triangle is half the product of a base and its corresponding height.
Hence here: $0.5 x(x+4)=40\\x(x+4)=80\\x^2+4x-80=0\\(x+2)^2-2^2-80=0\\(x+2)^2=84\\x+2=\pm\sqrt{80}\\x=-2\pm\sqrt{80}$
But we know that $x$ is non-negative, thus $x=-2+\sqrt{80}$