<s>[INST] a random variable has the density $f\left(x\right)=a+bx^{2}$ . Determine and b so that its mean will be 2/3 A random variable has the density  $f\left(x\right)=a+bx^{2}$ with  $0<x<1$. Determine and b so that its mean will be 2/3.
I'm a little confued trying to get a and b. This is what I already tried:
$$P\left(0<X<1\right)=\int_{0}^{1}ax^{2}dx+\int_{0}^{1}bx^{4}dx$$
$$P\left(0<X<1\right)=a\int_{0}^{1}x^{2}dx+b\int_{0}^{1}x^{4}dx=a\left(\frac{x^{3}}{3}\right)_{0}^{1}+b\left(\frac{x^{5}}{5}\right)_{0}^{1}$$
$$P\left(0<X<1\right)=a\left(\frac{1}{3}\right)+b\left(\frac{1}{5}\right)=\frac{a}{3}+\frac{b}{5}=\frac{5a+3b}{15}$$
$$E\left[X\right]=a\left(\frac{1}{3}\right)+b\left(\frac{1}{5}\right)=\frac{a}{3}+\frac{b}{5}=\frac{5a+3b}{15}$$
$$E\left[X\right]=\frac{2}{3}=\frac{5a+3b}{15}$$
$$10=5a+3b$$
I'm assuming x as a continuous random variable
In this case shouldn't be a=0 b=1?
 [/INST] You are mixing up the $P(X\in(0,1))=1$ and $E(X)=\frac 2 3$. The other post presumably showed you the expected value correctly, so $P(X\in(0,1))=\int_{-1}^1 f(x) dx=\int_0^1(a+bx^2)dx=\left[ax+\frac{bx^3}{3}\right]_{x=0}^1=a+\frac b 3=1$
Solving, you obtain $a=\frac 1 3, b=2$.
To check:
$E(X)=\int_{-\infty}^\infty xf(x)dx=\int_0^1x(\frac 1 3 + 2x^2)dx=\left[\frac{x^2}{6}+\frac{x^4}{2}\right]_{x=0}^1=\frac 2 3$
</s>