Calculating the mean and variance of a distribution 
*

*Suppose $$P(x) = \frac{1}{\sqrt{2\pi\cdot 36}}e^{-\frac{1}{2}\cdot (\frac{x-2}{6})^2}$$


What is the mean of $X$? What is the standard deviation of $X$?


*Suppose $X$ has mean $4$ and variance $4$. Let $Y = 2X+7$.


What is the mean of $Y$? What is the standard deviation of $Y$?
Are there resources that can help me answers these question? I have the answers, but I honestly have no idea how to solve them. Typically when I've seen mean and standard deviation, it's been in the context of finding them for a specific data set.
 A: Assuming $P$ is the probability density associated with $X$, note
that it is identical to the density of a normal random variable,
$$
P\left(x;\mu,\sigma\right)=\frac{1}{\sigma\sqrt{2\pi}}e^{-\frac{\left(x-\mu\right)^{2}}{2\sigma^{2}}}
$$
with $\mu=2$ and $\sigma=6$ (verify this as a simple exercise).
This should answer your first question.
As for the second question, you can use the properties of the expectation:
$$
E\left[\alpha X+\beta\right]=\alpha EX+\beta
$$
where $X$ is a random variable and $\alpha,\beta$ are constants.
Similarly, for variance
$$
\text{Var}\left[\alpha X+\beta\right]=\alpha^{2}\text{Var}\left[X\right].
$$
The variance is the standard deviation squared.
A: $\newcommand{\E}{\operatorname{E}}\newcommand{\var}{\operatorname{var}}$This density depends on $x$ only through $(x-2)^2$.  That entails that its values at the two points $2\pm\text{something}$ are both the same.  E.g. the random variable is just as likely to be in the vicinity of $2+7$ as in the vicinity of $2-7$.  That symmetry can tell you that the expected value must be $2$ unless the positive and negative parts both diverge to $\infty$ (as happens with the Cauchy distribution).
Are you familiar with the idea that $\E(X)= \int_{-\infty}^\infty xf(x)\,dx$ where (lower-case) $f$ is the probability density function of the random variable (capital) $X$?  Try it with with a density $f$ for which $f(2+\text{something})=f(2-\text{something})$ (regardless of which number "something" is):
\begin{align}
\E(X) & =\int_{-\infty}^\infty x f(x)\,dx = \left(\int_{-\infty}^2+\int_2^\infty\right) xf(x)\,dx\\[8pt]
& = \left(\int_{-\infty}^0+\int_0^\infty\right) (2+u)f(2+u)\,du \quad(\text{where }u=x-2) \\[8pt]
& = \underbrace{\int_{-\infty}^\infty 2f(2+u)\,du}_{\text{This $=\,2$}} + \left(\int_{-\infty}^0+\int_0^\infty\right) uf(2+u)\,du \\[8pt]
& = 2 + \int_0^\infty -wf(2+w)\,dw + \int_0^\infty 2 f(2+u)\,du \quad(\text{where }w=-u) \\[8pt]
& = 2 + 0.
\end{align}
The variance is somewhat more work. We have
$$
f(x)\,dx=\frac{1}{\sqrt{2\pi\cdot 36}}e^{-\frac{1}{2}\cdot (\frac{x-2}{6})^2}\,dx = \frac 1 {\sqrt{2\pi}} e^{-u^2/2}\,du
$$
where $u = \dfrac{x-2} 6$ so that $\dfrac{dx}{\sqrt{36}}=\dfrac{dx}6 = du$.
Hence
$$
\var(X) = \int_{-\infty}^\infty (x-2)^2 f(x)\,dx = \int_{-\infty}^\infty 36u^2 \frac 1 {\sqrt{2\pi}} e^{-u^2/2}\,du.
$$
Since this is an even function, this is
$$
36\cdot 2\int_0^\infty u^2 \frac 1 {\sqrt{2\pi}} e^{-u^2/2}\,du = 36\cdot2\cdot\frac 1 {\sqrt{2\pi}}\int_0^\infty u e^{-u^2/2}\,(u\,du)
$$
$$
= 36\cdot2\cdot\frac 1 {\sqrt{2\pi}} \int_0^\infty \sqrt{w} e^{-w}\,\frac{dw}2
$$
$$
= 36\cdot2\cdot\frac 1 {\sqrt{2\pi}} \Gamma\left(\frac 3 2 \right)\cdot 1 2 = 36\cdot2\cdot\frac 1 {\sqrt{2\pi}} \cdot\frac 1 2 \Gamma\left(\frac 1 2 \right) \cdot \frac 1 2 = 36.
$$
A: 1) Since: $X \sim N(\mu, \sigma^2)$ you have that:
$$\mu=2 \qquad \sigma^2=6^2$$
2) $$E[Y]=E[2X+7]=E[2X]+E[7]=2E[X]+E[7]$$
Substituting $E[X]$ with $\mu=4$, we get: $$E[Y]=2 \cdot 4+7=15$$
For what it concerns the variance: $$Var[Y]=\cdots=Var[2X]+Var[7]=2^2\cdot Var[X]+Var[7]$$
Substituting $Var[X]=\sigma^2=4$, and since the variance of a number is always zero we get that:
$$4\cdot4=16$$
