The compiler tells you what the error is, and where it is:
a.cpp:40:73: error: expected unqualified-id before '{' token
double nrmethod(int r1, double fr1, double dr1fr1, int imax, double es);{
^
In this case, an extraneous semicolon. You are going to have to learn to pay attention to what the compiler is telling you if you want to have any hope of being a programmer.