I was reading Introduction to quantum Mechanics [1st edition] by David Griffiths and was doing some exerciese, then I'm stuck on Problem 1.4.

Problem 1.3 The needle on a broken car speedometer is free to swing, and bounces perfectly off the pins at either end, so that if you give it a flick it is equally likely to come to rest at any angle between 0 and π.

(c) Compute <sin
θ>,<cosθ>, and <cos2θ>

Problem 1.4 We consider the same device as the previous problem, but this time we are interested in the x-coordinate of the needle point -- that is, the "shadow", or "projection", of the needle on the horizontal line.

(a) What is the probability density
ρ(x)? [ρ(x) dx is the probability that the projection lies between x and (x+dx).] Graph ρ(x) as a function of x, from -2r to +2r, where r is the length of the needle. Make sure the total probability is 1. [Hint: You know (from Problem 1.3) the probability that θ is in a given range; the question is, what interval dx corresponds to the interval dθ?]

(b) Compute <x>(average of x), <x2>(average of x), and
σ (standard deviation) for this distribution. Explain how you could have obtained these results from part (c) of problem 1.3.

Thank you for reading this, and if you don't bother, please give me some hints to solve this, I'm getting a headache.