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

theorem
  Z c= dom (sin*f) & (for x st x in Z holds f.x=a*x+b) implies sin*f
is_differentiable_on Z & for x st x in Z holds ((sin*f)`|Z).x = a* cos.(a*x+b)
proof
  assume that
A1: Z c= dom (sin*f) and
A2: for x st x in Z holds f.x=a*x+b;
  for y being object st y in Z holds y in dom f by A1,FUNCT_1:11;
  then
A3: Z c= dom f by TARSKI:def 3;
  then
A4: f is_differentiable_on Z by A2,FDIFF_1:23;
A5: for x st x in Z holds sin*f is_differentiable_in x
  proof
    let x;
    assume x in Z;
    then
A6: f is_differentiable_in x by A4,FDIFF_1:9;
    sin is_differentiable_in f.x by SIN_COS:64;
    hence thesis by A6,FDIFF_2:13;
  end;
  then
A7: sin*f is_differentiable_on Z by A1,FDIFF_1:9;
  for x st x in Z holds ((sin*f)`|Z).x = a* cos.(a*x+b)
  proof
    let x;
A8: sin is_differentiable_in f.x by SIN_COS:64;
    assume
A9: x in Z;
    then f is_differentiable_in x by A4,FDIFF_1:9;
    then diff(sin*f,x) = diff(sin, f.x)*diff(f,x) by A8,FDIFF_2:13
      .=cos.( f.x)*diff(f,x) by SIN_COS:64
      .=cos.(a*x+b)*diff(f,x) by A2,A9
      .=cos.(a*x+b)*(f`|Z).x by A4,A9,FDIFF_1:def 7
      .=a* cos.(a*x+b) by A2,A3,A9,FDIFF_1:23;
    hence thesis by A7,A9,FDIFF_1:def 7;
  end;
  hence thesis by A1,A5,FDIFF_1:9;
end;
