Find an expression for $A$ as a function of $x$. The area $A$ is defined as the area to the left of point $x$, within an equilateral triangle with sides of length $a$. Find an expression for $A$ as a function of $x$.
$(i)$ for $0\leq x\leq \dfrac a2$
 $(ii)$ for $\dfrac a 2\leq x\leq a$

See the problem in the above picture. Can anbody give me a hint on how to tackle this problem? I have no idea how to, mainly because $\dfrac{1}{2}a$ and $x$ aren't aligned, so I have no idea how to get the expression for $A$.
 A: Take $x$ such that $0<x\leq\dfrac a2$. (The strict inequality is there just to avoid an issue. What I'll get in the end is easily extendable to $x=0$).
As you should know, the area of a triangle is half of $\text{length of the base}\times\text{height}$. Since $x=\text{length of the base}$, all that it is left to do is find the height.
You're told that the triangle is equilateral, therefore all its angles are equal, hence its left most angle is $\dfrac \pi 3$. Thus $\tan \left(\dfrac \pi 3\right)=\dfrac {\text{height}} x$, hence $\text{height}=\sqrt 3x$. 
Therefore $A(x)=\dfrac 12x\cdot\sqrt 3x=\dfrac{\sqrt 3x^2}{2}$, for all $x$ such that $0<x\leq\dfrac a2$. Naturally $A(0)=0=\sqrt 3\cdot 0^2$.
Hence $A(x)=\dfrac{\sqrt 3x^2}{2}$, for all $x\in \left[0,\dfrac a2\right]$.
I'll leave the case where $x\in \left[\dfrac a2,a\right]$ to you with the following hint: instead of directly finding the total area for each $x$, note that you can easily find the area of the whole triangle and to get $A(x)$ you just need to subtract the missing part of the triangle from the total area.
A: $$
x \leq {a \over 2}
\quad\Longrightarrow\quad
{x \over a/2} = {h_{x} \over a\,\sin\left(\pi/3\right)}
\quad\Longrightarrow\quad
h_{x} = 2x\,{\sqrt{3} \over 2} = \sqrt{3\,}\,x
$$
$$
\color{#ff0000}{\large A} = {1 \over 2}\,xh_{x} = \color{#ff0000}{\large{\sqrt{3\,} \over 2}\,x^{2}\,,
\color{#0000ff}{\large\qquad x \leq {1 \over 2}\,a}}
$$
$$
\color{#ff0000}{\large A}
=
{\sqrt{3\,} \over 8}\,a^{2}
+
\left[
{\sqrt{3\,} \over 8}\,a^{2}-{\sqrt{3\,} \over 2}\,\left(a - x\right)^{2}\right]
=
\color{#ff0000}{\large{\sqrt{3\,} \over 4}\,a^{2}
-
{\sqrt{3\,} \over 2}\,\left(a - x\right)^{2}\,,
\color{#0000ff}{\large\qquad x \geq {1 \over 2}\,a}}
$$
