2a*(a+5)-(a-7)^2=(2a+10)*a-(a-7)^2=2a^2+10a-(a-7)^2=2a^2+10a-(a^2-14a+49)=2a^2+10a-a^2+14a-49=a^2+10a+14a-49=a^2+24a-49.
2a*(a+5)-(a-7)^2=(2a+10)*a-(a-7)^2=2a^2+10a-(a-7)^2=2a^2+10a-(a^2-14a+49)=2a^2+10a-a^2+14a-49=a^2+10a+14a-49=a^2+24a-49.