A piece of wire is 2 units long. One point on this wire is selected uniformly randomly. The wire is cut at this point, giving two smaller segments of wire of length $X_1$ and $X_2$. Notice that the average segment length is 1. Define the sum of squares of the deviations from 1:
$$S = (X_1 − 1)^2 + (X_2 − 1)^2$$
(a) Compute the distribution function and density function for S.
(b) Compute the expected value and variance of S.
I have gotten to the probability density function of $X_1$ and have created the cumulative density function of $X_1$ but I am having trouble transferring that to S.
Note: I created the formula $S_2=2-S_1$.
$X_1+X_2=2$ which leads to: $$S=(X_1-1)^2+(2-X_1-1)^2=2(X_1-1)^2$$
$X_1$ takes values in $[0,2]$ so that $S=2(X_1-1)^2$ takes values in $[0,2]$.
For $s\in[0,2]$ we find:$$F_{S}\left(s\right)=P\left(S\leq s\right)=P\left(\left(X_{1}-1\right)^{2}\leq\frac{1}{2}s\right)=P\left(1-\frac{\sqrt{s}}{\sqrt{2}}\leq X_{1}\leq1+\frac{\sqrt{s}}{\sqrt{2}}\right)=$$$$F_{X_{1}}\left(1+\frac{\sqrt{s}}{\sqrt{2}}\right)-F_{X_{1}}\left(1-\frac{\sqrt{s}}{\sqrt{2}}\right)$$
You already know the CDF of $X_{1}$ and by taking the derivative of $F_{S}\left(s\right)$ you can find its PDF.
You can find the expectation of $S$ by calculating the integral:$$\mathbb ES=\mathbb E2(X_1-1)^2=\int2(x-1)^2f_{X_1}(x)dx$$