If the rows of $\textbf{X}(n\times p)$ are i.i.d. $\mathcal{N}_p (\mu\textbf{1}, \Sigma)$ and $\textbf{C}$ is symmetric matrix then $\textbf{X}'\textbf{C}\textbf{X}$ has a $\mathcal{W}_p(\Sigma, r)$(Wishart distribution) if and only if
(1) $\textbf{C}$ is idempotent, and either
(2) $\mu = 0$ or $\textbf{C}\textbf{1} =0$.
In either case $tr(\textbf{C})=r$.
If part is easy to proof, I am looking for the only if part. I proceed in this way,
Let, $\textbf{Y}= \textbf{X}-\mu\textbf{1}\textbf{1}'$, then rows of $\textbf{Y}\sim\mathcal{N}_n(\textbf{0}, \Sigma)$. Now,$$ \textbf{X}'\textbf{C}\textbf{X} = \textbf{Y}'\textbf{C}\textbf{Y} + \textbf{Y}'\textbf{C}\textbf{1}\textbf{1}'\mu + \mu\textbf{1}\textbf{1}'\textbf{C}\textbf{Y} + (\textbf{1}'\textbf{C}\textbf{1})\textbf{1}\textbf{1}'\mu^2 $$ From only if part, we have $\textbf{X}'\textbf{C}\textbf{X}\sim\mathcal{W}_p(\Sigma, r)$
My question is from here (1) How do you claim that $\textbf{C}$ is idempotent?Here you can not apply Cochran theorem because $\mu\neq0$ and (2) and $\textbf{C1}=0$
Intuitively it is clear but I required a elegant solution to do that. How to proceed 'only if part'? Any answer appreciable.
Thanks in advance
I find it more convenient to use a corresponding result for chi-square distribution, from which your result will follow.
Proof of 'only if' part:
Suppose $X'AX\sim \chi^2_{r}(\delta)$. If $A$ has rank $k$ (say), then by spectral decomposition there is an orthogonal matrix $P$ such that $$P'AP=\operatorname{diag}(\lambda_1,\ldots,\lambda_k,0,\ldots,0)\,,$$
where $\lambda_1,\ldots,\lambda_k$ are the non-zero eigenvalues of $A$.
Define $U=(U_1,\ldots,U_n)'=P'X$. Then $$X'AX=U'(P'AP)U=\sum_{j=1}^k \lambda_jU_j^2$$
Now $U\sim N_n(\nu,I_n)$ with $\nu=(\nu_1,\ldots,\nu_n)'=P'\mu$, so that $U_j^2\sim \chi^2_1(\nu_j^2)$ and its characteristic function is
$$(1-2it)^{-1/2}\exp\left\{\frac{it\nu_j^2}{1-2it}\right\}$$
Since the $U_j$'s are independent, characteristic function of $\sum\limits_{j=1}^k \lambda_jU_j^2$ is
$$\prod_{j=1}^k \left[(1-2it\lambda_j)^{-1/2}\exp\left\{\frac{it\lambda_j\nu_j^2}{1-2it\lambda_j}\right\}\right]=\prod_{j=1}^k (1-2it\lambda_j)^{-1/2}\exp\left\{it\sum_{j=1}^k\frac{\lambda_j\nu_j^2}{1-2it\lambda_j}\right\}\tag{1}$$
But again characteristic function of a $\chi^2_r(\delta)$ distribution is
$$(1-2it)^{-r/2}\exp\left\{\frac{it\delta}{1-2it}\right\}\tag{2}$$
Equating $(1)$ and $(2)$ we have by the unique factorization of polynomials that $k=r,\lambda_j=1$ for $j=1,\ldots,k$ and $\delta=\sum\limits_{j=1}^k \nu_j^2$.
Therefore $P'AP=\begin{bmatrix}I_r & 0 \\ 0 & 0\end{bmatrix}$, which is idempotent. In other words, $$P'AP=(P'AP)(P'AP)=P'A^2P$$
That is, $$A^2=A$$
Now back to your question.
Suppose $\mathbf X=(X_1,X_2,\ldots,X_n)'$ where the rows $X_i$ are i.i.d $N_p(\mu,\Sigma)$ for all $i=1,\ldots,n$ and assume that $\Sigma$ is positive definite. Let $\operatorname{rank}(C)=r$ where $C$ is an $n\times n$ symmetric matrix.
Define $Y_i=X_i-\mu$, so that $Y_i\sim N_p(0,\Sigma)$ independently for all $i$. Let $\mathbf Y$ be the centred matrix given by $$\mathbf Y=(Y_1,\ldots,Y_n)'=\mathbf X-\mathbf1_n\mu'$$
By definition, $\mathbf X'C\mathbf X\sim W_p(\Sigma,r)$ means $$\mathbf X'C\mathbf X=\sum_{i=1}^r Y_iY_i'\tag{3}$$
Again define $y=(y_1,\ldots,y_n)'=\mathbf Y\ell$ where $\ell$ is a non-zero $p\times 1$ vector of constants.
Clearly $y_i=\ell'Y_i$ are i.i.d $N(0,\sigma_\ell^2)$ where $\sigma_\ell^2=\ell'\Sigma\ell$.
So we have $y\sim N_n(0,\sigma_\ell^2 I_n)$. Equivalently, $\mathbf X\ell \sim N_n(\mu'\ell \mathbf1_n,\sigma_\ell^2 I_n)$, i.e. $$\frac{\mathbf X\ell}{\sigma_\ell}\sim N_n(\mu'\ell \mathbf1_n, I_n)$$
Now using $(3)$,
$$\left(\frac{\mathbf X\ell}{\sigma_\ell}\right)'C\left(\frac{\mathbf X\ell}{\sigma_\ell}\right)=\frac{\ell'\mathbf X'C\mathbf X\ell}{\sigma_\ell^2} =\frac1{\sigma_\ell^2}\sum_{i=1}^r \ell'Y_iY_i'\ell =\frac1{\sigma_\ell^2}\sum_{i=1}^r y_i^2 \sim \chi^2_r \tag{4}$$
So $C$ must be idempotent using the theorem at the start.
But when $C$ is idempotent, $\left(\frac{\mathbf X\ell}{\sigma_\ell}\right)'C\left(\frac{\mathbf X\ell}{\sigma_\ell}\right)$ has a $\chi^2$ distribution with degrees of freedom $\operatorname{rank}(C)=r$ and noncentrality parameter $(\mu'\ell \mathbf1_n)'C(\mu'\ell \mathbf1_n)$.
The noncentrality parameter must vanish in accordance with $(4)$, giving
$$(\mu'\ell)^2 \mathbf1_n' C\mathbf1_n=0$$
That is, $$\mu=0 \quad\text{ or }\quad C\mathbf1_n=0 $$