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
  (Z c= dom (f(#)sec) & for x st x in Z holds f.x=a*x+b) implies (f(#)
sec) is_differentiable_on Z & for x st x in Z holds ((f(#)sec)`|Z).x = a/cos.x+
  (a*x+b)*sin.x/(cos.x)^2
proof
  assume that
A1: Z c= dom (f(#)sec) and
A2: for x st x in Z holds f.x=a*x+b;
A3: Z c= dom f /\ dom sec by A1,VALUED_1:def 4;
  then
A4: Z c= dom sec by XBOOLE_1:18;
A5: Z c= dom f by A3,XBOOLE_1:18;
  then
A6: f is_differentiable_on Z by A2,FDIFF_1:23;
A7: for x st x in Z holds sec is_differentiable_in x & diff(sec, x)=sin.x/(
  cos.x)^2
  proof
    let x;
    assume x in Z;
    then cos.x<>0 by A4,RFUNCT_1:3;
    hence thesis by Th1;
  end;
  then for x st x in Z holds sec is_differentiable_in x;
  then
A8: sec is_differentiable_on Z by A4,FDIFF_1:9;
  for x st x in Z holds ((f(#)sec)`|Z).x = a/cos.x+(a*x+b)*sin.x/(cos.x) ^2
  proof
    let x;
    assume
A9: x in Z;
    then ((f(#)sec)`|Z).x= (sec.x)*diff(f,x)+(f.x)*diff(sec,x) by A1,A6,A8,
FDIFF_1:21
      .=(sec.x)*((f`|Z).x)+(f.x)*diff(sec,x) by A6,A9,FDIFF_1:def 7
      .=(sec.x)*a+(f.x)*diff(sec,x) by A2,A5,A9,FDIFF_1:23
      .=(sec.x)*a+(a*x+b)*diff(sec,x) by A2,A9
      .=(sec.x)*a+(a*x+b)*(sin.x/(cos.x)^2) by A7,A9
      .=a/cos.x+(a*x+b)*sin.x/(cos.x)^2 by A4,A9,RFUNCT_1:def 2;
    hence thesis;
  end;
  hence thesis by A1,A6,A8,FDIFF_1:21;
end;
