reserve y for set,
  x,r,a,b for Real,
  n for Element of NAT,
  Z for open Subset of REAL,
  f,f1,f2,f3 for PartFunc of REAL,REAL;

theorem
  Z c= dom ((sin+cos)/exp_R) implies (sin+cos)/exp_R
is_differentiable_on Z & for x st x in Z holds (((sin+cos)/exp_R)`|Z).x =-2*sin
  .x/exp_R.x
proof
  assume Z c= dom ((sin+cos)/exp_R);
  then Z c= dom (sin+cos) /\ (dom exp_R \ (exp_R)"{0}) by RFUNCT_1:def 1;
  then
A1: Z c= dom (sin+cos) by XBOOLE_1:18;
  then
A2: sin+cos is_differentiable_on Z by Th38;
A3: exp_R is_differentiable_on Z & for x st x in Z holds exp_R.x<>0 by
FDIFF_1:26,SIN_COS:54,TAYLOR_1:16;
  then
A4: (sin+cos)/exp_R is_differentiable_on Z by A2,FDIFF_2:21;
  for x st x in Z holds (((sin+cos)/exp_R)`|Z).x =-2*sin.x/exp_R.x
  proof
    let x;
     reconsider xx=x as Element of REAL by XREAL_0:def 1;
A5: (sin+cos).xx=sin.xx+cos.xx by VALUED_1:1;
A6: exp_R.x <>0 by SIN_COS:54;
    assume
A7: x in Z;
    then exp_R is_differentiable_in x & sin+cos is_differentiable_in x by A2,
FDIFF_1:9,SIN_COS:65;
    then
    diff((sin+cos)/exp_R,x) =(diff(sin+cos,x) * exp_R.x - diff(exp_R,x) *
    (sin+cos).x)/(exp_R.x)^2 by A6,FDIFF_2:14
      .=(((sin+cos)`|Z).x* exp_R.x - diff(exp_R,x) *(sin+cos).x)/(exp_R.x)^2
    by A2,A7,FDIFF_1:def 7
      .=((cos.x-sin.x)* exp_R.x - diff(exp_R,x) *(sin+cos).x)/(exp_R.x)^2 by A1
,A7,Th38
      .=((cos.x-sin.x)* exp_R.x - exp_R.x*(sin.x+cos.x))/(exp_R.x)^2 by A5,
SIN_COS:65
      .=((-2*sin.x)*exp_R.x)/((exp_R.x)*(exp_R.x))
      .=(-2*sin.x)*(exp_R.x/((exp_R.x)*(exp_R.x))) by XCMPLX_1:74
      .=(-2*sin.x)*((exp_R.x)/(exp_R.x)/(exp_R.x)) by XCMPLX_1:78
      .=(-2*sin.x)*(1/exp_R.x) by A6,XCMPLX_1:60
      .=(-(2*sin.x))/exp_R.x by XCMPLX_1:99
      .=-2*sin.x/exp_R.x by XCMPLX_1:187;
    hence thesis by A4,A7,FDIFF_1:def 7;
  end;
  hence thesis by A2,A3,FDIFF_2:21;
end;
