Maximizing the perimeter of a triangle inside a square BdMO 2014:

We have  a square $ABCD$ of side length 5.We take a point $E$ on $AD$ and $F$ on $AB$ so that $\angle FCE=45^\circ$. What can be the maximum perimeter of $\triangle AEF$?

I can  construct the angle in such a way that the diagonal bisects it and then see if the perimeter is increasing or decreasing as we go to the left using the angle-bisector theorem.Is there a better and more rigorous way?
As a followup question,what is the maximum perimeter if $E$ does not fall on $A$ and $F$ on $B$ given that the perimeter is an integer?
NOTE: No trigonometry allowed. 
Edit:trig allowed now.
 A: Claim: The perimeter of $\Delta AEF$ is 10 no matter where it is drawn.
We proceed by giving a way to construct the point $F$ on $AB$ once a given point $E$ on $AD$ is chosen, assuming $E$ is interior to this interval. First construct the circle $K$ centered at vertex $C$ of the square, of radius $5$. Then $K$ is tangent to sides $AD$ and $AB$ at the points $D,B$ respectively. Now from $E$ construct the other tangent to circle $K,$ which meets $K$ at the point $P$ and when extended meets side $AB$ at some point $F.$ 
We have $ED=EP$ since the lengths of tangents from a point outside a circle are equal, and similarly $FB=FP$. We now have congruent right triangles $\Delta EDC \equiv \Delta EPC$ and also $\Delta FPC \equiv \Delta FBC.$ We therefore have
$$\angle DCE= \angle ECP =x, \\ \angle PCF = \angle FCB = y.$$
Two copies each of $x,y$ then fill out the whole 90 degree angle at corner $C$ of the square, and so $x+y=45=\angle ECF.$
There can only be one point $F$ on $AB$ which makes $\angle ECF=45,$ so the above construction has given the desired point $F$.
But now a series of equalities shows the perimeter of $\Delta AEF$ is always $10.$
$AE+AF+EF = AE+AF + (EP+PF) = (AE+EP)+(AF+FP)$ 
$= (AE+ED)+(AF+FB)=AD+AB=5+5=10.$
A trig approach (requested by OP in a comment)
The square is ABCD where say A is the upper right, B the lower right, C the lower left, and D the upper left vertex of the square. Then the point F is on the right vertical side, and E is on the top horizontal side, with the angle FCE given to be 45 degrees. Let $x$ be angle BCF and $y$ be angle DCE, so that $x+y=45$ degrees.
For notation let $t(\theta)=\tan \theta.$ Then $BF=5t(x)$ and $DE=5t(y),$ and since all the sides are 5 we have
$$ FA=5(1-t(x)), \\ EA = 5(1-t(y). \tag{1}$$
Using Pythagoras' theorem to get the diagonal of triangle EAF gives
$$EF^2=FA^2+EA^2=25[(1-t(x))^2+(1-t(y))^2] \\ 
=25[ 2-2(t(x)+t(y))+t(x)^2+t(y)^2]. \tag{2}$$
Now since $x+y=45$ and tangent of 45 is 1, we get from the sum formula for tangent that $(t(x)+t(y))/(1-t(x)t(y))=1.$ This means we can replace $t(x)+t(y)$ in $(2)$ by $1-t(x)t(y).$ When this is done we find we get $EF^2=25[(t(x)+t(y))^2]$, which means $EF=5(t(x)+t(y).$ When this is added to the sum $FA+EA$ the result is the constant $10$ because the tangents cancel, making the perimeter of the triangle $AEF$ constantly $10$ independent of the angles $x,y.$
