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 (sec*(f1+c(#)f2)) & f2=#Z 2 & (for x st x in Z holds f1.x = a
+b*x) implies sec*(f1+c(#)f2) is_differentiable_on Z & for x st x in Z holds ((
  sec*(f1+c(#)f2))`|Z).x = (b+2*c*x)*sin.(a+b*x+c*x^2)/(cos.(a+b*x+c*x^2))^2
proof
  assume that
A1: Z c= dom (sec*(f1+c(#)f2)) and
A2: f2=#Z 2 and
A3: for x st x in Z holds f1.x = a+b*x;
  dom (sec*(f1+c(#)f2)) c= dom (f1+c(#)f2) by RELAT_1:25;
  then
A4: Z c= dom (f1+c(#)f2) by A1,XBOOLE_1:1;
  then
A5: (f1+c(#)f2) is_differentiable_on Z by A2,A3,FDIFF_4:12;
  Z c= dom f1 /\ dom (c(#)f2) by A4,VALUED_1:def 1;
  then
A6: Z c= dom (c(#)f2) by XBOOLE_1:18;
A7: for x st x in Z holds cos.((f1+c(#)f2).x)<>0
  proof
    let x;
    assume x in Z;
    then (f1+c(#)f2).x in dom sec by A1,FUNCT_1:11;
    hence thesis by RFUNCT_1:3;
  end;
A8: for x st x in Z holds sec*(f1+c(#)f2) is_differentiable_in x
  proof
    let x;
    assume
A9: x in Z;
    then cos.((f1+c(#)f2).x)<>0 by A7;
    then
A10: sec is_differentiable_in (f1+c(#)f2).x by Th1;
    (f1+c(#)f2) is_differentiable_in x by A5,A9,FDIFF_1:9;
    hence thesis by A10,FDIFF_2:13;
  end;
  then
A11: sec*(f1+c(#)f2) is_differentiable_on Z by A1,FDIFF_1:9;
  for x st x in Z holds ((sec*(f1+c(#)f2))`|Z).x = (b+2*c*x)*sin.(a+b*x+c
  *x^2)/(cos.(a+b*x+c*x^2))^2
  proof
    let x;
    assume
A12: x in Z;
    then
A13: ( f1+c(#)f2).x=f1.x+(c(#)f2).x by A4,VALUED_1:def 1
      .=f1.x +c*f2.x by A6,A12,VALUED_1:def 5
      .=a+b*x +c*(f2.x) by A3,A12
      .=a+b*x +c*(x #Z 2) by A2,TAYLOR_1:def 1
      .=a+b*x +c*(x |^2) by PREPOWER:36
      .=a+b*x+c*x^2 by NEWTON:81;
A14: (f1+c(#)f2) is_differentiable_in x by A5,A12,FDIFF_1:9;
A15: cos.((f1+c(#)f2).x)<>0 by A7,A12;
    then sec is_differentiable_in (f1+c(#)f2).x by Th1;
    then
    diff(sec*(f1+c(#)f2),x) = diff(sec, (f1+c(#)f2).x)*diff((f1+c(#)f2),x
    ) by A14,FDIFF_2:13
      .=(sin.((f1+c(#)f2).x)/(cos.((f1+c(#)f2).x))^2)*diff((f1+c(#)f2),x) by
A15,Th1
      .=((f1+c(#)f2)`|Z).x*(sin.(a+b*x+c*x^2)/(cos.(a+b*x+c*x^2))^2) by A5,A12
,A13,FDIFF_1:def 7
      .=(b+2*c*x)*(sin.(a+b*x+c*x^2)/(cos.(a+b*x+c*x^2))^2) by A2,A3,A4,A12,
FDIFF_4:12;
    hence thesis by A11,A12,FDIFF_1:def 7;
  end;
  hence thesis by A1,A8,FDIFF_1:9;
end;
