We studied the ac Josephson effect. The phase difference is expanded i
n a Fourier series. The Fourier components can be evaluated by solving
the equations of motion. Truncation was applied to deal with the infi
nite products and series of Bessel functions. It is very efficient if
the nonlinearity is not too large. We give some numerical results and
derive the de current response. The latter has a different form from p
revious works. The Shapiro steps were also studied with the same metho
d and a more accurate step size estimation is given.