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 Th13:
  Z c= dom (ln*(f1+c(#)f2)) & f2=#Z 2 & (for x st x in Z holds f1.
  x=a+b*x & (f1+c(#)f2).x >0) implies (ln*(f1+c(#)f2)) is_differentiable_on Z &
  for x st x in Z holds ((ln*(f1+c(#)f2))`|Z).x = (b+2*c*x)/(a+b*x+c*x |^2)
proof
  assume that
A1: Z c= dom (ln*(f1+c(#)f2)) and
A2: f2=#Z 2 and
A3: for x st x in Z holds f1.x=a+b*x & (f1+c(#)f2).x >0;
  for y being object st y in Z holds y in dom (f1+c(#)f2) by A1,FUNCT_1:11;
  then
A4: Z c= dom (f1+c(#)f2) by TARSKI:def 3;
  then Z c= dom f1 /\ dom (c(#)f2) by VALUED_1:def 1;
  then
A5: Z c= dom (c(#)f2) by XBOOLE_1:18;
A6: for x st x in Z holds f1.x=a+b*x by A3;
  then
A7: (f1+c(#)f2) is_differentiable_on Z by A2,A4,Th12;
A8: for x st x in Z holds ln*(f1+c(#)f2) is_differentiable_in x
  proof
    let x;
    assume x in Z;
    then (f1+c(#)f2) is_differentiable_in x & (f1+c(#)f2).x >0 by A3,A7,
FDIFF_1:9;
    hence thesis by TAYLOR_1:20;
  end;
  then
A9: ln*(f1+c(#)f2) is_differentiable_on Z by A1,FDIFF_1:9;
  for x st x in Z holds ((ln*(f1+c(#)f2))`|Z).x = (b+2*c*x)/(a+b*x+c*x |^ 2)
  proof
    let x;
    assume
A10: x in Z;
    then x in dom (f1+c(#)f2) by A1,FUNCT_1:11;
    then
A11: ( f1+c(#)f2).x=f1.x + (c(#)f2).x by VALUED_1:def 1
      .=f1.x +c*f2.x by A5,A10,VALUED_1:def 5
      .=a+b*x +c*(f2.x) by A3,A10
      .=a+b*x +c*(x #Z 2) by A2,TAYLOR_1:def 1
      .=a+b*x +c*(x |^2) by PREPOWER:36;
    (f1+c(#)f2) is_differentiable_in x & ( f1+c(#)f2).x >0 by A3,A7,A10,
FDIFF_1:9;
    then
diff(ln*( f1+c(#)f2),x) =diff(( f1+c(#)f2),x)/(( f1+c(#)f2).x) by TAYLOR_1:20
      .=(( f1+c(#)f2)`|Z).x/(( f1+c(#)f2).x) by A7,A10,FDIFF_1:def 7
      .=(b+2*c*x )/(a+b*x+c*(x |^2)) by A2,A4,A6,A10,A11,Th12;
    hence thesis by A9,A10,FDIFF_1:def 7;
  end;
  hence thesis by A1,A8,FDIFF_1:9;
end;
