Let $f(x)=\frac{2}{(b-\theta )^{2}}(x-\theta )$ be a probability density function of random sample $(X_{1},X_{2},...,X_{n}) $where $\theta < x< b$ ($b$ is known constant) .Find unbiased estimator for $\theta $.
$E(\bar{X})=E(X)=\int_{\theta }^{b}x\frac{2}{(b-\theta )^{2}}(x-\theta )dx=\frac{2}{(b-\theta )^{2}}\left [ \frac{b^{3}}{3}-\frac{\theta b^{2}}{2}-\frac{\theta ^{3}}{3}+\frac{\theta ^{3}}{2} \right ]$
But I've stucked here. I could not find estimator for $\theta$. Any help will be appreciated.
Note that the random variable $X$ is a location-scale transformed $\operatorname{Beta}(2,1)$ distribution: specifically, $$Y = \frac{X - \theta}{b - \theta} \sim \operatorname{Beta}(2,1),$$ since $$f_Y(y) = f_X((b-\theta)y + \theta) (b-\theta) = 2y \mathbb 1 (0 < y < 1).$$ Consequently, $Y$ is a pivotal quantity. Its expectation will be $$\operatorname{E}[Y] = \int_{y=0}^1 2y \, dy = \frac{2}{3},$$ consequently, $$\operatorname{E}[X \mid \theta, b] = \operatorname{E}[(b-\theta)Y + \theta] = (b-\theta)\operatorname{E}[Y] + \theta = \frac{2b + \theta}{3}.$$ For a general iid sample of size $n$, linearity of expectation implies $$\operatorname{E}[\bar X \mid \theta, b] = \operatorname{E}[X \mid \theta, b],$$ so an unbiased estimator of $\theta$ is $3\bar X - 2b$.
As you can see, you are working with unnecessary computations that are obscuring the underlying structure. Simplifying what you obtained for the expectation will lead you to the same result as shown above, but you would not have needed to perform such algebraic manipulation had you seen how the parameter $\theta$ specifies a location for $X$; therefore, we can simplify the computation by translating and scaling the density.