Step 1: Recall the expression for strain energy.
For a member subjected to an axial load,
\[
U=\frac{1}{2}P\delta,
\]
where \(\delta\) is the axial deformation.
Step 2: Substitute the deformation.
The axial deformation is
\[
\delta=\frac{PL}{AE}.
\]
Hence,
\[
U
=
\frac12 P
\left(\frac{PL}{AE}\right)
=
\frac{P^2L}{2AE}.
\]
Therefore,
\[
\boxed{
U=\frac{P^2L}{2AE}
}
\]
Hence,
\[
\boxed{(D)}
\]
is the correct answer.