The task goes as following:
Divide the length of $14$ into parts $a$ and $b$, in a way that the sum of surfaces of two squares (which sizes are $a$ and $b$), is minimal.
$14=a+b => b=14-a$ $....(1)$
P1 $=a^2$
P2 $=b^2$ $...(2)$
$(1)$ into $(2):$
P2 $=(14-a)^2=a^2-28a+196$
$f(a)=$P1$+$P2
$f(a)=a^2+a^2-28a+196$
$f(a)=2a^2-28a+196$
for $f(a)$ to be minimal, $f'(a)=0$ or $f'(a)=NaN$
$f'(a)=4a-28$
$4(a-7)=0$ for $a=7$ ; can't be NaN
So, I drew a table, provided here:

And it turns out that for value $a=7$, function is minimal, so the solution indeed is $a=7$ and $b=7$.
My question is: What if, instead of minimal, sum of surfaces needed to be maximal? Solving the task goes the same, because for both maximal and minimal value of function (solved here) the condition is the same, and the table you get is the same. But this function is convex, it has no maximum, and I would've expected to get $14$ and $0$ as solution. How is this possible?
I hope I'm making myself clear. Thanks in advance!
My teacher explained it to me today. Maximum value of convex functions tends to infinity, but here I am limited with $a + b = 14$, meaning that 14 is the range of this function. Thus, I cannot reach maximum value of $f(x)$, but I can reach maximum value in a way that I stay in the domain. In that domain, function has maximum value for 0 and 14. Every point on graph higher than $(0, f(0))$ and $(14, f(14))$ is ignored because its outside of the domain.