      subroutine _rhs(idum,nx,p1,p3,p4,c)
      integer nx
      real p1(nx),p3(nx),p4(nx),c(nx)
      real r1,r1p1,d1,d1p1
      integer i,j,nxm1
C
      r1=p1(1)+p3(1)
      r1p1=p1(2)+p3(2)
      d1p1=r1-r1p1
      p4(1)=0.0
      nxm1=nx-1
      do 10 i=2,nxm1
      j=i+1
      r1=r1p1
      r1p1=p1(j)+p3(j)
      d1=d1p1
      d1p1=r1p1-r1
      p4(i)=r1+c(i)*(d1-d1p1)
 10   continue
      p4(nx)=0.0
      return
      end
