reserve r,x,x0,a,b for Real;
reserve n,m for Element of NAT;
reserve A for non empty closed_interval Subset of REAL;
reserve Z for open Subset of REAL;

theorem Th8:
  n<>0 implies ((1/(n^2))(#)(sin*AffineMap(n,0))- (AffineMap(1/n,0)
  )(#)(cos*AffineMap(n,0))) is_differentiable_on REAL & for x holds (((1/(n^2))
(#)(sin*AffineMap(n,0))- (AffineMap(1/n,0))(#)(cos*AffineMap(n,0)))`|REAL).x=x*
  sin.(n*x)
proof
A1: dom (((1/(n^2))(#)(sin*AffineMap(n,0))- (AffineMap(1/n,0))(#)(cos*
  AffineMap(n,0)))) = [#]REAL by FUNCT_2:def 1;
A2: dom (AffineMap(1/n,0))=REAL & for x st x in REAL holds AffineMap(1/n,0)
  .x=(1 /n)*x + 0 by FCONT_1:def 4,FUNCT_2:def 1;
  then
A3: AffineMap(1/n,0) is_differentiable_on REAL by A1,FDIFF_1:23;
A4: for x st x in REAL holds AffineMap(n,0).x=n*x + 0 by FCONT_1:def 4;
A5: dom (sin*AffineMap(n,0)) = [#]REAL by FUNCT_2:def 1;
  then
A6: sin*(AffineMap(n,0)) is_differentiable_on REAL by A4,FDIFF_4:37;
A7: dom ((1/(n^2))(#)(sin*AffineMap(n,0)))=REAL by FUNCT_2:def 1;
  then
A8: (1/(n^2))(#)(sin*AffineMap(n,0)) is_differentiable_on REAL by A1,A6,
FDIFF_1:20;
  assume
A9: n<>0;
A10: for x st x in REAL holds (((1/(n^2))(#)(sin*AffineMap(n,0)))`|REAL).x =
  (1/n)*cos(n*x)
  proof
    let x;
    assume
A11: x in REAL;
    (((1/(n^2))(#)(sin*AffineMap(n,0)))`|REAL).x =(1/(n^2))*diff((sin*
    AffineMap(n,0)),x) by A7,A1,A6,FDIFF_1:20,A11
      .=(1/(n^2))*((sin*AffineMap(n,0))`|REAL).x by A6,FDIFF_1:def 7,A11
      .=(1/(n^2))*(n * cos.(n*x+0)) by A5,A4,FDIFF_4:37,A11
      .= n*(1/(n*n))*(cos.(n*x+0))
      .= (n*1)/(n*n)*(cos.(n*x+0)) by XCMPLX_1:74
      .= (1/n)*(cos.(n*x+0)) by A9,XCMPLX_1:91;
    hence thesis;
  end;
A12: dom (cos*AffineMap(n,0)) = [#]REAL by FUNCT_2:def 1;
  then
A13: cos*AffineMap(n,0) is_differentiable_on REAL by A4,FDIFF_4:38;
A14: dom ((AffineMap(1/n,0))(#)(cos*AffineMap(n,0)))=REAL by FUNCT_2:def 1;
  then
A15: ((AffineMap(1/n,0))(#)(cos*AffineMap(n,0))) is_differentiable_on REAL
  by A1,A3,A13,FDIFF_1:21;
 hence ((1/(n^2))(#)(sin*AffineMap(n,0))- (AffineMap(1/n,0)
  )(#)(cos*AffineMap(n,0))) is_differentiable_on REAL
 by A1,A8,FDIFF_1:19;
A16: for x st x in REAL holds (((AffineMap(1/n,0))(#)(cos*AffineMap(n,0)))`|
  REAL).x = (1/n)*cos.(n*x)-x* sin.(n*x)
  proof
    let x;
    assume
A17: x in REAL;
    (((AffineMap(1/n,0))(#)(cos*AffineMap(n,0)))`|REAL).x = ((cos*
AffineMap(n,0)).x)*diff(AffineMap(1/n,0),x) + (AffineMap(1/n,0).x)*diff(cos*(
    AffineMap(n,0)),x) by A14,A1,A3,A13,FDIFF_1:21,A17
      .= ((cos*AffineMap(n,0)).x)*((AffineMap(1/n,0)`|REAL).x) +(AffineMap(1
    /n,0).x)*diff((cos*AffineMap(n,0)),x) by A3,FDIFF_1:def 7,A17
      .= ((cos*AffineMap(n,0)).x)*(1/n)+(AffineMap(1/n,0).x) *diff((cos*
    AffineMap(n,0)),x) by A1,A2,FDIFF_1:23,A17
      .= ((cos*AffineMap(n,0)).x)*(1/n)+(AffineMap(1/n,0).x) *(((cos*
    AffineMap(n,0))`|REAL).x) by A13,FDIFF_1:def 7,A17
      .= ((cos*AffineMap(n,0)).x)*(1/n) +(AffineMap(1/n,0).x)*(-n* sin.(n*x+
    0)) by A12,A4,FDIFF_4:38,A17
      .= ((cos*AffineMap(n,0)).x)*(1/n) +((1/n)*x + 0)*(-n* sin.(n*x+0)) by
FCONT_1:def 4
      .= (cos.(AffineMap(n,0).x))*(1/n) +((1/n)*x)*(-n* sin.(n*x+0)) by A12,
FUNCT_1:12,A17
      .= (1/n)*cos.(n*x)+(-((1/n)*n*x* sin.(n*x))) by FCONT_1:def 4
      .= (1/n)*cos.(n*x)+(-(1*x* sin.(n*x))) by A9,XCMPLX_1:87
      .= (1/n)*cos.(n*x)-x* sin.(n*x);
    hence thesis;
  end;
A18:
  for x st x in REAL holds (((1/(n^2))(#)(sin*AffineMap(n,0))- (AffineMap
  (1/n,0))(#)(cos*AffineMap(n,0)))`|REAL).x = x*sin.(n*x)
  proof
    let x;
    assume
A19: x in REAL;
    (((1/(n^2))(#)(sin*AffineMap(n,0))- (AffineMap(1/n,0))(#)(cos*
AffineMap(n,0)))`|REAL).x = diff((1/(n^2))(#)(sin*AffineMap(n,0)),x) - diff((
    AffineMap(1/n,0))(#)(cos*AffineMap(n,0)),x) by A1,A8,A15,FDIFF_1:19,A19
      .= ((((1/(n^2))(#)(sin*AffineMap(n,0)))`|REAL).x) - diff(AffineMap(1/n
    ,0)(#)(cos*AffineMap(n,0)),x) by A8,FDIFF_1:def 7,A19
      .= (1/n)*cos(n*x)-diff(AffineMap(1/n,0) (#)(cos*AffineMap(n,0)),x)
          by A10,A19
      .= (1/n)*cos(n*x)-(((AffineMap(1/n,0) (#)(cos*AffineMap(n,0)))`|REAL).
    x) by A15,FDIFF_1:def 7,A19
      .= (1/n)*cos(n*x)-((1/n)*cos.(n*x)-x* sin.(n*x)) by A16,A19
      .= x* sin.(n*x);
    hence thesis;
  end;
  let x;
   x in REAL by XREAL_0:def 1;
  hence thesis by A18;
end;
