function values = GradJacobiP(x,alpha,beta,deg)

% evaluate the derivative of the Jacobi polynomial of type (alpha,beta) > -1 and order deg,
% at points x and gives result in values (same dimensions like x)

values = zeros(size(x));
if deg == 0
    return;
else
    values = sqrt(deg * (deg + alpha + beta + 1)) * JacobiP(x,alpha + 1,beta + 1,deg - 1);
end

end