%% Find Cauchy Principal Value
% Define a symbolic function f(x) = 1/(x-1) that has a pole at x=1.

syms x
f(x) = 1/(x-1)

% Compute the definite integral of this function from x = 0 to x=2. Since the integration interval includes the pole, the result is not defined.

F = int(f,[0 2])

% However, the Cauchy principal value of the integral exists. To compute the Cauchy principal value of the integral, set 'PrincipalValue' to true.

F = int(f,[0 2],'PrincipalValue',true)

%
% Copyright 2006-2019 The MathWorks, Inc.