function error = residual_nonlinear(f_approx1, f_approx2,phi_x, z)
global eps;global delv;
vdx_fn = vdx_fn_perd_1st(f_approx1);
vdx_fn =  MultiD_times(vdx_fn,sig_1(z));

%phi_x = Phi_x_nonlinear(f_approx2,z);
[M,M_plus] = M_np1(phi_x);
A = A_VPFP_linear_depz_diag(M, M_plus);
Pf = Trig_Multi(A,f_approx2./M).*M/(delv^2);
Pf =  MultiD_times(Pf,sig_3(z)/eps);
error = vdx_fn - Pf; 
