reserve x,a,b,c for Real,
  n for Nat,
  Z for open Subset of REAL,
  f, f1,f2 for PartFunc of REAL,REAL;

theorem Th6:
  Z c= dom (tan*f) & (for x st x in Z holds f.x = a*x+b) implies
tan*f is_differentiable_on Z & for x st x in Z holds ((tan*f)`|Z).x = a/(cos.(a
  *x+b))^2
proof
  assume that
A1: Z c= dom (tan*f) and
A2: for x st x in Z holds f.x = a*x+b;
  dom(tan*f) c= dom f by RELAT_1:25;
  then
A3: Z c= dom f by A1,XBOOLE_1:1;
  then
A4: f is_differentiable_on Z by A2,FDIFF_1:23;
A5: for x st x in Z holds cos.(f.x)<>0
  proof
    let x;
    assume x in Z;
    then f.x in dom (sin/cos) by A1,FUNCT_1:11;
    hence thesis by Th1;
  end;
A6: for x st x in Z holds tan*f is_differentiable_in x
  proof
    let x;
    assume
A7: x in Z;
    then cos.(f.x)<>0 by A5;
    then
A8: tan is_differentiable_in f.x by FDIFF_7:46;
    f is_differentiable_in x by A4,A7,FDIFF_1:9;
    hence thesis by A8,FDIFF_2:13;
  end;
  then
A9: tan*f is_differentiable_on Z by A1,FDIFF_1:9;
  for x st x in Z holds ((tan*f)`|Z).x = a/(cos.(a*x+b))^2
  proof
    let x;
    assume
A10: x in Z;
    then
A11: f is_differentiable_in x by A4,FDIFF_1:9;
A12: cos.(f.x)<>0 by A5,A10;
    then tan is_differentiable_in f.x by FDIFF_7:46;
    then diff(tan*f,x) = diff(tan, f.x)*diff(f,x) by A11,FDIFF_2:13
      .=(1/(cos.(f.x))^2) * diff(f,x) by A12,FDIFF_7:46
      .=diff(f,x)/(cos.(a*x+b))^2 by A2,A10
      .=(f`|Z).x/(cos.(a*x+b))^2 by A4,A10,FDIFF_1:def 7
      .=a/(cos.(a*x+b))^2 by A2,A3,A10,FDIFF_1:23;
    hence thesis by A9,A10,FDIFF_1:def 7;
  end;
  hence thesis by A1,A6,FDIFF_1:9;
end;
