% breakaway.m
clc
format compact

syms s
Dp = expand (s*(s+1)^2*(s+4))
N = [1 2]
D = [1 6 9 4 0]
G = tf (N, D)
rlocus (G);

% breakaway points
test = conv (N, polyder(D)) - conv (polyder(N), D)   % ND' - N'D
roots (test)

display ('Hit Enter to continue');
pause
close all 
clc