# Finding $Cov(2X+7, X^2 +3X - 12)$

So I have this pdf, $f(x)=3x^2$ for $x\in (0,1)$ and I need to find $Cov(2X+7, X^2+3X-12)$. My main concern about how I answer this is, what is the joint pdf for these two distributions? I guess it's $f(x)$ but I wanted to confirm this.

But as for actually calculating the covariance, I first use the fact that constant terms can vanish, so that I instead calculate $Cov(2X, X^2+3X)$. I'll use the definition of covariance which tells me to compute

$$\int\int_{R}(x-\mu_{X})(y-\mu_{Y})f(x,y)dA$$

so I need to know each mean for $2X$ and $X^2+3X$. I know how to calculate those, so to avoid writing too much, let's assume I've found their values. Then I believe the integral I want to compute is

$$\int_{0}^{1}(x-\mu_X)(x-\mu_Y)f(x)dx$$

Is this correct?

• It seems you are posting a lot of what looks like school work? If this is school work, please mark your posts with the "self-study" tag. Mar 23, 2015 at 0:52
• @StatsStudent I'm not in the class (so I'm learning this independently) but it is material from a class. I can label it as self-study if that helps. Mar 23, 2015 at 0:56
• You do not need the joint of $(2X+7, X^2+3X-12)$ to compute the covariance. And no, the joint pdf of $(2X+7, X^2+3X-12)$ is not $f(x)$. Mar 23, 2015 at 7:14

Use the fact that, $$\text{Cov}(X,X) = \text{Var}(X)$$ and that, $$\text{Cov}(aX+bY,cW+dV) = ac \,\text{Cov}(X,W)+ad\,\text{Cov}(X,V)+bc\,\text{Cov}(Y,W)+ bd\,\text{Cov}(Y,V)$$
• Also, after having done this, I suppose I should remark (to confirm that I'm right, and for the sake of anyone who might read this later) that it seems you still ultimately need to compute $E(X), E(X^2),$ and $E(X^3)$. Mar 23, 2015 at 1:19
• There is no contradiction between stoched's solution and $$\int\int_{\mathbb{R}^2}(x-\mu_{X})(y-\mu_{Y})f(x,y)\text{d}x\text{d}y$$ since this is the definition of covariance. The second equation $$\int_{0}^{1}(x-\mu_X)(x-\mu_Y)f(x)\text{d}x$$ is wrong. Since $x^2+3x=\psi(x)$ is a function of $x$, it should read $$\int_{0}^{1}(x-\mu_X)(\Psi(x)-\mu_Y)f(x)\text{d}x$$ Mar 23, 2015 at 7:18
• I take it $\Psi(x)=\int_0^x(t^2 + 3t)dt$? How does this follow from the definition of covariance? I've tried taking another stab at this to try to make sure I understand all this, and I got: Since we have basically $Cov(V,W)$ where $V=2X+7$ and $W=X^2+3X-12$ so if $V=v=2x+7$ and $W=w=x^2+3x-12$ then $Cov(V,W)=\int_0^1\int_0^1(v-\mu_V)(w-\mu_W)f(x)dx = \int_0^1\int_0^1(2x+7-\mu_V)(x^2+3x-12-\mu_W)f(x)dx$. I'm sure you're right about this, but I'm not understanding the exact justification for what you got or how my result went wrong. Mar 23, 2015 at 20:49
• @Xi'an Actually, I think maybe my mistake was using the same $x$ for both variables when technically they should be distinct? Maybe. I don't know. Mar 23, 2015 at 20:50