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

theorem
  Z c= dom (f1-((1/(4*a))(#)(sin*f))) & (for x st x in Z holds f1.x=x/2
  & f.x=2*a*x) & a<>0 implies f1-((1/(4*a))(#)(sin*f)) is_differentiable_on Z &
  for x st x in Z holds ((f1-((1/(4*a))(#)(sin*f)))`|Z).x =(sin(a*x))^2
proof
  assume that
A1: Z c= dom (f1-((1/(4*a))(#)(sin*f))) and
A2: for x st x in Z holds f1.x=x/2 & f.x=2*a*x and
A3: a<>0;
A4: Z c= dom f1 /\ dom ((1/(4*a))(#)(sin*f)) by A1,VALUED_1:12;
  then
A5: Z c= dom ((1/(4*a))(#)(sin*f)) by XBOOLE_1:18;
A6: for x st x in Z holds f1.x=(1/2)*x+0
  proof
    let x;
    assume x in Z;
    then f1.x=x/2 by A2
      .= (1/2)*x+0;
    hence thesis;
  end;
A7: for x st x in Z holds f.x=2*a*x by A2;
  then
A8: (1/(4*a))(#)(sin*f) is_differentiable_on Z by A3,A5,Th43;
A9: Z c= dom f1 by A4,XBOOLE_1:18;
  then
A10: f1 is_differentiable_on Z by A6,FDIFF_1:23;
  for x st x in Z holds ((f1-((1/(4*a))(#)(sin*f)))`|Z).x =(sin(a*x))^2
  proof
    let x;
    assume
A11: x in Z;
    then
    ((f1-((1/(4*a))(#)(sin*f)))`|Z).x =diff(f1,x)-diff(((1/(4*a))(#)(sin*
    f)),x) by A1,A8,A10,FDIFF_1:19
      .=(f1`|Z).x-diff(((1/(4*a))(#)(sin*f)),x) by A10,A11,FDIFF_1:def 7
      .=(f1`|Z).x-(((1/(4*a))(#)(sin*f))`|Z).x by A8,A11,FDIFF_1:def 7
      .=(f1`|Z).x-1/2 * cos(2*a*x) by A3,A7,A5,A11,Th43
      .=1/2-1/2 * cos(2*a*x) by A9,A6,A11,FDIFF_1:23
      .=(1/2)*(1-cos(2*(a*x)))
      .=(1/2)*(2*(sin(a*x))^2) by Lm1
      .=(sin(a*x))^2;
    hence thesis;
  end;
  hence thesis by A1,A8,A10,FDIFF_1:19;
end;
