function [ val ] = second_moment( theta, lambda, X )
%SECOND_MOMENT Summary of this function goes here
%   Detailed explanation goes here

if theta < lambda
    exp_kappa_theta = lambda / (lambda - theta);
    val = mean(exp_kappa_theta*exp(-theta*X));
else
    val = Inf;
end

end

