import javax.swing.JOptionPane;
import H5O2;
import fxi;

class f1 extends fxi
{
  double f(double x[])
  {
  return x[0]*x[0]-x[1];
  }
}

class f2 extends fxi
{
  double f(double x[])
  {
  return Math.sin(x[0])+Math.cos(x[1]);
  }
}

public class H5O2b
{
  public static void main(String args[])
  {
  String s="";
  f1 b1;
  b1=new f1();
  double x[]=new double[2];
  x[0]=1;
  x[1]=1;
  s+="Integral int(f1,x[0]=0,1;x[1]=1)   : "+H5O2.integral(b1,x,0,0,1)+"\n";
  s+="Integral int(f1,x[1]=0,1;x[0]=1)   : "+H5O2.integral(b1,x,1,0,1)+"\n";
  f2 b2;
  b2=new f2();
  x[0]=0;
  x[1]=Math.PI/2.0;
  s+="Integral int(f2,x[0]=0,1;x[1]=1)   : "+H5O2.integral(b2,x,0,0,1)+"\n";
  s+="Integral int(f2,x[1]=0,1;x[0]=1)   : "+H5O2.integral(b2,x,1,0,1)+"\n";
  JOptionPane.showMessageDialog(null,s);
  System.exit(0);
}
}
