You can find the whole integration routine here https://github.com/ad-si/Woxi/blob/36343ab2cbc97e5081f7c811e.... It's essentially a test mock-up (not even trying partial fraction decomposition for rational functions).
// ∫ tan(x) dx = -ln|cos(x)| - not implemented (requires Log)