# sum_(r=1)^(r=4) {[sin((2r-1)pi/8)]^4 +[cos((2r-1)pi/8]^4}#
Taking #(2r-1)pi/8=theta#
# {[sin((2r-1)pi/8)]^4 +[cos((2r-1)pi/8]^4}#
#= {[sintheta]^4 +[costheta]^4}.#
#={[sin^2theta +cos^2theta]^2-2sin^2thetacos^2theta}#
#={1^2-1/2(2sinthetacostheta)^2}#
#={1^2-1/2sin^2 2theta}#
# ={1-1/2sin^2 (2r-1)pi/4}#
# ={1-1/2sin^2 ((rpi)/2-pi/4))}#
# ={1-1/2(pm1/sqrt2)^2}color(red)"*"#
# ={1-1/4 }=3/4#
#[color(red)"*"=>sin((rpi)/2-pi/4)=pmsin(pi/4) or pmcos(pi/4)" for " r in ZZ^"+"]#
So
# sum_(r=1)^(r=4) {[sin((2r-1)pi/8)]^4 +[cos((2r-1)pi/8]^4}#
# =sum_(r=1)^(r=4) {3/4}=4xx3/4=3#