the 1/2 comes from a trig identity.

cos^2(x) = (1 + cos(2x))/2 = 1/2 (1 + cos(2x))

the 9/2 dtheta should be 9/2 theta and it comes from adding 4 theta and 1/2 theta.

so that line is kinda wrong. let's do the problem. Note, i'll use x for theta, cause LaTex isn't working and typing out theta everytime gets annoying.

A = 1/2*int{(2 + cosx)^2}dx

= 1/2 * int{4 + 4cosx + cos^2(x)}dx

= 1/2 * [int{4 + 4cosx}dx + int{cos^2(x)}dx]

= 1/2 * [int{4 + 4cosx}dx + (1/2)*int{1 + cos(2x)}dx] .......applied the identity mentioned above

= 1/2 * [(4x + 4sinx) + (1/2)(x + (1/2)sin(2x))] ..........took the integrals, now simplify

= 1/2 * [4x + 4sinx + (1/2)x + (1/4)sin(2x)]

= 1/2 * [(9/2)x + 4sinx + (1/4)sin(2x)] .......here's the 9/2 again, i got it from adding 4x and (1/2)x

Now we evaluate the integral between 0 and 2pi as directed.

= 1/2 * {[(9/2)*2pi + 4sin(2pi) + (1/4)sin(4pi)] - [0]}

= 1/2 * [9pi + 0 + 0]

= 9/2 pi