\documentclass[a4paper,12pt]{article}
\begin{document}

QUESTION
 A good model for the variation, from item to item, of a quality
  characteristic of a certain manufactured product is a random
  variable X with probability density function
  $f(x)=\frac{2x}{\lambda^2},\ 0 \leq x \leq \lambda$. Each of the
  manufactured items is tested and items for which $X>1$, where
  $0<1<\lambda$, are passed and the rest are rejected. The cost of
  a rejected item is $c=a\lambda +b$ and the profit on a passed
  item is $C-c$. The parameter $\lambda$ can be adjusted to any
  desired value. Find $\lambda$ such that the expected profit is
  maximised.


ANSWER
 $f(x)=\frac{2x}{\lambda^2},\ 0 \leq x \leq \lambda$\\

  \begin{eqnarray*}
   \textrm{Profit}&=&(C-c)\textrm{ if }X>L\\
   &=&-c \textrm{ if }X\leq L\\
  E( \textrm{Profit})&=&(C-c)P(X>L)-cP(X \leq L)\\
   &=&CP(X>L)-c
  \end{eqnarray*}

  $P(X>L)=\int_L^\lambda
  \frac{2x}{\lambda^2}\,dx=[\frac{x^2}{\lambda^2}]_L^\lambda=1-\frac{L^2}{\lambda^2}\\
  E(\textrm{profit})=C(1-\frac{L^2}{\lambda^2})-(a\lambda +b)\\
  \frac{dE(\textrm{profit})}{d\lambda}=\frac{2cL^2}{\lambda^3}-a=0$ when
  $\lambda^3=\frac{2CL^2}{a}$
 $$\lambda=\sqrt[3]{\frac{2CL^2}{a}}$$
 Check that $\frac{d^2E(\textrm{profit})}{d\lambda^2}<0$ to confirm
 that this is the maximum.

\end{document}
