The problem is: Let $p+2q=3$ and find the maximum of $pq$. Of course I could solve this as below: $$pq=(3-2q)q=-2(q-\frac{3}{4})^2+\frac{9}{8}$$ so, the maximum is $\frac{9}{8}$.
However, I got another solution i.e. using AMGM inequality. $$\sqrt{pq} \leq \frac{p+q}{2}$$ This gave me the answer $\text{max} (pq)=1$ and I think this is wrong. But I have no idea what is wrong in AMGM solution.
AMGM solution $\sqrt{pq} = \frac{p+q}{2}$ iff $p=q$. so let $p=q$ and then $p=q=1$. This means $pq\leq 1^2=1$, so the maximum of $pq$ is $1$.
I appreciate any help, thanks in advance!
it is about your second solution : we know $\sqrt{xy} \leq \frac{x+y}{2}$ so use it correctly.
we suppose $p+2q=3$ then take $x=p , y=2q$ $$\color{red}{\sqrt{(p)(2q)} \leq \frac{(p)+(2q)}{2}}$$ this mean $$\sqrt{2pq)} \leq \frac{3}{2}$$ to the power of two $$2pq\leq \dfrac94 \to pq \leq \dfrac98 \to \max{(pq)}=\dfrac98$$