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 Th3:
  (1/(n+1))(#)( #Z (n+1)*sin) is_differentiable_on REAL & for x
  holds (((1/(n+1))(#)( #Z (n+1)*sin))`|REAL).x = ((sin.x) #Z n)*cos.x
proof
A1: [#]REAL = dom((1/(n+1))(#)( #Z (n+1)*sin)) by FUNCT_2:def 1;
  #Z (n+1)*sin is_differentiable_in x0
  proof
    sin is_differentiable_in x0 by SIN_COS:64;
    hence thesis by TAYLOR_1:3;
  end;
  then
  [#]REAL = dom ( #Z (n+1)*sin) & for x0 st x0 in REAL holds #Z (n+1)*sin
  is_differentiable_in x0 by FUNCT_2:def 1;
  then
A2: #Z (n+1)*sin is_differentiable_on REAL by FDIFF_1:9;
  hence (1/(n+1))(#)( #Z (n+1)*sin) is_differentiable_on REAL by A1,FDIFF_1:20;
A3: for x st x in REAL holds (( #Z (n+1)*sin)`|REAL).x=(n+1) * ((sin.x) #Z n
  )*cos.x
  proof
    set m=n+1;
    let x;
    assume
A4: x in REAL;
    sin is_differentiable_in x by SIN_COS:64;
    then diff(( #Z m*sin),x) = m * (sin.x) #Z (m-1) *diff(sin,x) by TAYLOR_1:3
      .= m * (sin.x) #Z (m-1) *(cos .x) by SIN_COS:64;
    hence thesis by A2,FDIFF_1:def 7,A4;
  end;
A5:
  for x st x in REAL holds (((1/(n+1))(#)( #Z (n+1)*sin))`|REAL).x =(sin.x
  ) #Z n *cos.x
  proof
    let x;
    assume
A6: x in REAL;
    (((1/(n+1))(#)( #Z (n+1)*sin))`|REAL).x =(1/(n+1))*diff( #Z (n+1)*sin
    ,x) by A1,A2,FDIFF_1:20,A6
      .=(1/(n+1))*((( #Z (n+1)*sin)`|REAL).x) by A2,FDIFF_1:def 7,A6
      .=(1/(n+1))*((n+1) * (sin.x) #Z n *cos.x) by A3,A6
      .=(1/(n+1))*(n+1) * (sin.x) #Z n *cos.x
      .=(n+1)/(n+1) * (sin.x) #Z n *cos.x by XCMPLX_1:99
      .=1*(sin.x) #Z n *cos.x by XCMPLX_1:60;
    hence thesis;
  end;
  let x;
   x in REAL by XREAL_0:def 1;
  hence thesis by A5;
end;
