Find the maximum value of $M$ with given constraints. 
Let $a, b \in \mathbb{R}$ such that $n^{4a-\log_5{n^2}} \leq 25^{40-b^2}$ for all positive real number $n$. Find the maximum value of $M=a^2+b^2+a-3b$.

What I have tried:
Taking the logarithm base 5 of both sides from the inequality, we get $(4a-2\log_5{n})\log_5n\leq2(40-b^2)$
Now, let $x=\log_5 n$, we get $x(4a-2x)\leq2(40-b^2)$, and this is equivalent to $x^2+2ax-b^2+40
\geq0$
The new inequality is true if and only if the discriminant $4a^2-4(40-b^2)\leq0$, this is equivalent to $a^2+b^2\leq40$, so we have $\max(a^2+b^2)=40$
This gave me hope of finding the maximum value of $M$ by finding the maximum value of $a-3b$ but I have no idea how to do it.
I'd like to call for some help. Thank you!

I want to contribute my solution using geometry :D
As Cesareo told above, our problem now is to find the maximum value of $f(a,b)=a^2+b^2+a-3b$ knowing that $a^2+b^2 \leq 40$.
Geometrically, $\sqrt{a^2+b^2}$ is the distance between the point $M(a,b)$ and the origin $O(0,0)$, so the condition $a^2+b^2 \leq 40$ means that $M(a,b)$ lies inside the circle $(C)$ whose center and radius are respectively $O(0,0)$ and $\sqrt{40}$. By some calculations, we have
$$f(a,b)=\left(a+\dfrac{1}{2}\right)^2+\left(b-\dfrac{3}{2}\right)^2-\dfrac{5}{2}=MI^2-\dfrac{5}{2},$$
where $I\left(-\dfrac{1}{2},\dfrac{3}{2}\right)$. Hence, to find the maximum of $f(a,b)$ means to find the maximum of $MI$.
At this point, note that $I$ lies inside $(C)$ since $OI^2=\dfrac{5}{2}<40$. Therefore the position of $M$ maximizing $f(a,b)$ is one of two nodes of the diameter of $(C)$ which passes through $M$; that is,
$$\max f(a,b)=\max \left\{IA^2-\dfrac{5}{2},IB^2-\dfrac{5}{2}\right\},$$
where $AB$ is a diameter of $(C)$ containing $M$.
The following part is my calculations. The equation of the line $OI$ is $3x+y=0$. The coordinates of $A$ and $B$ satisfy the system
$$\begin{cases}
3x+y=0 \\
x^2+y^2=40
\end{cases} \Leftrightarrow \begin{cases}
y=-3x \\
x^2+(-3x)^2=40
\end{cases} \\ \begin{cases}
y=-3x \\
10x^2=40
\end{cases} \Leftrightarrow \begin{cases}
x=2 \\
y=-6
\end{cases} \vee \begin{cases}
x=-2 \\
y=6
\end{cases}$$
Thus $\max f(a,b)=\max \left\{IA^2-\dfrac{5}{2},IB^2-\dfrac{5}{2}\right\}=\max \left\{60,20\right\}=60.$
Hope this helps. ^^
