The mathematics of circuit analysis