A question on $p$-groups, and order of its commutator subgroup. $\textbf{QUESTION-}$
Let $P$ be a p-group with $|P:Z(P)|\leq p^n$. Show that $|P'| \leq p^{n(n-1)/2}$.
If $P=Z(P)$ it is true. Now let $n > 1$, then
If I see $P$ as a nilpotent group and construct its upper central series, it will end , so let it be,
$e=Z_0<Z_1<Z_2<......<Z_r=P$ 
Now as $Z_{i+1}/Z_i=Z(P/Z_i)$, so if if I take some $x\in Z_2$\ $Z_1$ then $N$={$[x,y]|y\in P$} $\leq Z_1(P)$ and $N \triangleleft P $, so $P/N$ is a group with order $\leq p^{n-1}$.
Now if I let $H=P/N$ then obviously |$H/Z(H)$|$\leq p^{n-1}$.
Now $H'\cong P'N/N \cong P'/(P' \cap N)$ so from here I could finally bring $P'$ atleast into the picture, now |$P'$|=$|H'|.|P'\cap N|$ so $|P'|\leq |H'||N|$. 
This is where I am $\textbf{STUCK}$
Now , from here how can I calculate or find some power $p$ bounds on $|H'|$ and $|N|$ so i could get my result.
 A: The case when $n=1$ is trivial, since a group $P$ such that $P/Z(P)$ is cyclic is already abelian.
Now consider a maximal subgroup $M$ containing $Z(P)$, where $[P:M]=p$. Then by induction (since $Z(P)\le Z(M)$) $|M'|\le p^{(n-1)(n-2)/2}$.
If we look at $P/M'$, then $M/M'$ is an abelian normal subgroup such that (by the second isomorphism theorem) $(P/M')/(M/M')$ is cyclic (since $P/M$ is). 
By Lemma 4.6 in FGT $|M/M'| = |P'/M'|\cdot |M/M'\cap Z(P/M')|$. 
This is the same as $|M| =|P'|\cdot |M/M'\cap Z(P/M')|$.
Let $K/M' = Z(P/M')$.  Thus we have
$$ |M| = |P'|\cdot \dfrac{|M\cap K|}{|M'|}.$$
If we can show $Z(P)\le M\cap K$, then we have
$$ |M| \ge |P'|\cdot\dfrac{|Z(P)|}{|M'|},$$
which is equivalent to 
$$ |P'| \le \dfrac{|M|\cdot |M'|}{|Z(P)|},$$
which implies
$$ |P'| \le p^{n(n-1)/2}$$
by the bound on $|M'|$, the bound on $|P/Z(P)|$, and the fact $M$ is a maximal subgroup (of index $p$).
So we already know $Z(P)\le M$ (by definition), and since the image of $Z(P)$ in $P/M'$ is central, we have $Z(P)\le K$. We are done.
A: For $n=0,1$, as you observe, there is nothing to prove.
Suppose now that the proposition is true for $n-1$, $n \geq 2 $
The first observation is that if $n \geq 2 $, $Z < Z_{2}$, so we can choose $x \in Z_{2} \setminus Z$.
Consider now the function $\alpha: P \rightarrow P$, $y \mapsto \left[ x,y \right]$. Since $x \in Z_{2}$ we have that  $ \alpha\left( y \right)= \left[ x,y \right] \in Z$ which is abelian so that $\alpha$ is a group morphism. Let $N := \operatorname{Im}\left( \alpha \right)$. We have that $\operatorname{Ker}\left( \alpha \right)= C_{G}\left( x \right)$ (the centraliser of $x$) and that $Z < C_{G}\left( x \right) $ since $x \in C_{G}\left( x \right) \setminus Z$. From this it follows 
$$
\left| N \right| = \left| \dfrac{P}{C_{G}\left( x \right)} \right| < \left| \dfrac{P}{Z} \right| \leq p^n
$$
i.e. 
$$\tag{1}\label{1}
\left| N \right| \leq p^{n-1}
$$
$N$ is normal in $P$ because it is central and we can construct $H = P/N$. We have that $ \dfrac{Z}{N} < Z\left( H \right) $ because $xN \in Z\left( H \right) \setminus \dfrac{Z}{N} $ so that 
$$
\left| \dfrac{H}{Z\left( H \right)} \right| < \left| \dfrac{H}{\dfrac{Z}{N}} \right| = \left| \dfrac{P}{Z} \right| \leq p^n$$
we can that deduce that $\left| H / Z\left( H \right)  \right|  \leq p^{n-1}$ and, by induction hypothesis,
$$\tag{2}\label{2} \left| H^\prime \right| \leq p^{\frac{\left( n-1 \right) \left( n-2 \right)}{2}}$$.
The final observation is that $N \leq P^\prime$ and 
$$\tag{3}\label{3} P^\prime / N \leq H^\prime$$ and putting all together we have:
$$ \left| P^\prime \right| \stackrel{\eqref{3}}\leq \left| H^\prime \right| \left| N \right| \stackrel{\eqref{1}\eqref{2}}\leq p^{\frac{\left( n-1 \right) \left( n-2 \right)}{2}} p^{n-1} = p^{\frac{n \left( n-1 \right)}{2}} $$
