@TomSawyer246,
Putting the functions in terms of c1 & c2
c1=y1-s & c2=y2+(1+r)s
So
T(s,B,y1,y2,r)=U(c1)+B*U(c2)
Where U(c)=-1/2c^2
Note I'm assuming the function U(c) is -c^2/2, not -1/(2c^2)
Substituting
T(s,B,y1,y2,r)=-1/2(y1-s)^2+B(-1/2(y1+(1+r)s)^2=-1/2((y1-s)^2+(y2+(1+r)s)^2)
now as y1,y2,B & r are all specified then the only variable is s so
T(s,B,y1,y2,r)=G(s) and
G(s)=)=-1/2((y1-s)^2+(y2+(1+r)s)^2)=-1/2((y1^2-2y1s+s^2)+y2^2+2(y2(1+r)s+s^2)
Combining terms
G(s)=-1/2((y1^2+y2^2-2(y1-y2(1+r))s+2s^2)
now y1^2+y2^2 is a constant (k1), (y1-y2(1+r) is a constant (k2)
so
G(s)=-1/2(k1-2k2s+2s^2)
differentiate G(s) with respect to s and set the differential equal to zero to find the maximum or minimum
dG(s)/ds=0=-1/2(k1-2k2+4s)
and solve for s
k1-2k2+4s=0
s=(2k2-k1)/4
to determine if the function is a maximum differentiate a second time and see if it is negative
dG^2(s)/ds^2=-4/2=-2 which is negative so that is a maximum
Rap