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 Th7:
  m+n<>0 & m-n<>0 implies ((-(1/(2*(m+n)))(#)(cos*AffineMap(m+n,0))
  ) - (1/(2*(m-n)))(#)(cos*AffineMap(m-n,0))) is_differentiable_on REAL & for x
  holds ((-((1/(2*(m+n)))(#)(cos*AffineMap(m+n,0)))- (1/(2*(m-n)))(#)(cos*
  AffineMap(m-n,0)))`|REAL).x = sin.(m*x) * cos.(n*x)
proof
  assume that
A1: m+n <> 0 and
A2: m-n <> 0;
A3: dom (cos*AffineMap(m+n,0)) = [#]REAL & for x st x in REAL holds
  AffineMap(m+ n,0).x=(m+n)*x + 0 by FCONT_1:def 4,FUNCT_2:def 1;
  then
A4: cos*AffineMap(m+n,0) is_differentiable_on REAL by FDIFF_4:38;
A5: for x st x in REAL holds ((-(1/(2*(m+n)))(#)(cos*AffineMap(m+n,0)))`|
  REAL).x=(1/2)*sin((m+n)*x)
  proof
    let x;
    assume
A6: x in REAL;
A7: dom (((-1)/(2*(m+n)))(#)(cos*AffineMap(m+n,0)))=[#]REAL by FUNCT_2:def 1;
    ((-(1/(2*(m+n)))(#)(cos*AffineMap(m+n,0)))`|REAL).x =((((-1)*(1/(2*(m
    +n)))) (#)(cos*AffineMap(m+n,0)))`|REAL).x by RFUNCT_1:17
      .=(((-(1/(2*(m+n))))(#)(cos*AffineMap(m+n,0)))`|REAL).x
      .=((((-1)/(2*(m+n)))(#)(cos*AffineMap(m+n,0)))`|REAL).x by XCMPLX_1:187
      .=((-1)/(2*(m+n)))*diff((cos*AffineMap(m+n,0)),x) by A4,A7,FDIFF_1:20,A6
      .=((-1)/(2*(m+n)))*((cos*AffineMap(m+n,0))`|REAL).x by A4,FDIFF_1:def 7,
A6
      .=((-1)/(2*(m+n)))*(-(m+n)* sin.((m+n)*x+0)) by A3,FDIFF_4:38,A6
      .=(-(-1)/(2*(m+n)))*(m+n)* sin.((m+n)*x+0)
      .=(1/(2*(m+n)))*(m+n)* sin.((m+n)*x+0) by XCMPLX_1:190
      .=((1*(m+n))/(2*(m+n)))* sin.((m+n)*x+0) by XCMPLX_1:74
      .=(1/2)* sin((m+n)*x) by A1,XCMPLX_1:91;
    hence thesis;
  end;
A8: dom (-(1/(2*(m+n)))(#)(cos*AffineMap(m+n,0))) = [#]REAL by FUNCT_2:def 1;
  dom ((1/(2*(m+n)))(#)(cos*AffineMap(m+n,0))) = [#]REAL by FUNCT_2:def 1;
  then (-(1/(2*(m+n)))(#)(cos*AffineMap(m+n,0))) = (-1)(#) ((1/(2*(m+n)))(#)(
  cos* AffineMap(m+n,0))) & (1/(2*(m+n)))(#)(cos*AffineMap(m+n,0))
  is_differentiable_on REAL by A4,FDIFF_1:20;
  then
A9: (-(1/(2*(m+n)))(#)(cos*AffineMap(m+n,0))) is_differentiable_on REAL by A8,
FDIFF_1:20;
A10: REAL = dom ((-(1/(2*(m+n)))(#)(cos*AffineMap(m+n,0)))- (1/(2*(m-n)))(#)(
  cos*AffineMap(m-n,0))) by FUNCT_2:def 1;
A11: dom (cos*AffineMap(m-n,0)) = [#]REAL & for x st x in REAL holds
  AffineMap(m- n,0).x=(m-n)*x + 0 by FCONT_1:def 4,FUNCT_2:def 1;
  then
A12: cos*(AffineMap(m-n,0)) is_differentiable_on REAL by FDIFF_4:38;
A13: dom ((1/(2*(m-n)))(#)(cos*AffineMap(m-n,0))) = [#]REAL by FUNCT_2:def 1;
  then
A14: (1/(2*(m-n)))(#)(cos*AffineMap(m-n,0)) is_differentiable_on REAL by A12,
FDIFF_1:20;
 hence ((-(1/(2*(m+n)))(#)(cos*AffineMap(m+n,0))
  ) - (1/(2*(m-n)))(#)(cos*AffineMap(m-n,0))) is_differentiable_on REAL
 by A8,A10,A9,FDIFF_1:19;
A15: for x st x in REAL holds (((1/(2*(m-n)))(#)(cos*AffineMap(m-n,0)))`|
  REAL).x=-(1/2)*sin((m-n)*x)
  proof
    let x;
    assume
A16: x in REAL;
    (((1/(2*(m-n)))(#)(cos*AffineMap(m-n,0)))`|REAL).x =(1/(2*(m-n)))*
    diff((cos*AffineMap(m-n,0)),x) by A13,A12,FDIFF_1:20,A16
      .=(1/(2*(m-n)))*((cos*AffineMap(m-n,0))`|REAL).x by A12,FDIFF_1:def 7,A16
      .=(1/(2*(m-n)))*(-(m-n)* sin.((m-n)*x+0)) by A11,FDIFF_4:38,A16
      .=(-1/(2*(m-n)))*(m-n)* sin.((m-n)*x+0)
      .=((-1)/(2*(m-n)))*(m-n)* sin.((m-n)*x+0) by XCMPLX_1:187
      .=(((-1)*(m-n))/(2*(m-n)))* sin.((m-n)*x+0) by XCMPLX_1:74
      .=(-1)/2* sin((m-n)*x) by A2,XCMPLX_1:91;
    hence thesis;
  end;
A17:
  for x st x in REAL holds ((-(1/(2*(m+n)))(#)(cos*AffineMap(m+n,0))- (1/
  (2*(m-n)))(#)(cos*AffineMap(m-n,0)))`|REAL).x = sin.(m*x) *cos.(n*x)
  proof
    let x;
    assume
A18: x in REAL;
    ((-(1/(2*(m+n)))(#)(cos*AffineMap(m+n,0))- (1/(2*(m-n)))(#)(cos*
AffineMap(m-n,0)))`|REAL).x = diff((-(1/(2*(m+n)))(#)(cos*AffineMap(m+n,0))),x)
    -diff((1/(2*(m-n)))(#)(cos*AffineMap(m-n,0)),x)
         by A8,A10,A9,A14,FDIFF_1:19,A18
      .= ((-(1/(2*(m+n)))(#)(cos*AffineMap(m+n,0)))`|REAL).x -diff((1/(2*(m-
    n)))(#)(cos*AffineMap(m-n,0)),x) by A9,FDIFF_1:def 7,A18
      .= ((-(1/(2*(m+n)))(#)(cos*AffineMap(m+n,0)))`|REAL).x -(((1/(2*(m-n))
    )(#)(cos*AffineMap(m-n,0)))`|REAL).x by A14,FDIFF_1:def 7,A18
      .= (1/2)*sin((m+n)*x)-(((1/(2*(m-n))) (#)(cos*AffineMap(m-n,0)))`|REAL
    ).x by A5,A18
      .= (1/2)*sin((m+n)*x)-(-(1/2)* sin((m-n)*x)) by A15,A18
      .= (1/2)*(sin((m+n)*x)+sin((m-n)*x))
      .= (1/2)*(2*(cos(((m+n)*x-(m-n)*x)/2) *sin(((m+n)*x+(m-n)*x)/2))) by
SIN_COS4:15
      .= sin.(m*x)*cos.(n*x);
    hence thesis;
  end;
  let x;
   x in REAL by XREAL_0:def 1;
  hence thesis by A17;
end;
