!set title=Producto

!goto $wims_read_parm

:present
 Tenemos dos funciones derivables, $m_f y $m_g. Sea $m_h
 el producto de estas funciones: $m_h(x) = $m_f(x)$m_g(x) para todo $m_x.
 <p>
 El objetivo es calcular $m_h'($cent). (<b>Indicación.</b> La derivada de $m_f
 es distinta de cero en los puntos que le pueden interesar.)
!exit

:form
 $m_h'($cent) = <input size=3 name=ans1>.
!exit

:ans
 You think that $m_h'($cent) = $ans1.
 !ifval $ans1=$good1
  <font color=green>Su respuesta es correcta</font>.
 !else
  <font color=red>Su respuesta no es correcta</font>: $m_h'($cent)=$good1.
 !endif
 !exit

:init
 storename=cent,ncent,pos,neg

 pos=!randitem 1,2,3,4
 neg=$[-($pos)]

 objname=las funciones
 hint=Recuerde la regla de Leibniz.
 
 parm1=$m_f($neg)\
  $m_f($neg) = \
  $m_f($neg) = ??
 parm2=$m_f(0)\
  $m_f(0) = \
  $m_f(0) = ??
 parm3=$m_f($pos)\
  $m_f($pos) = \
  $m_f($pos) = ??
 parm4=$m_f '($neg)\
  $m_f '($neg) = \
  $m_f '($neg) = ??
 parm5=$m_f '(0)\
  $m_f '(0) = \
  $m_f '(0) = ??
 parm6=$m_f '($pos)\
  $m_f '($pos) = \
  $m_f '($pos) = ??
 parm7=$m_g($neg)\
  $m_g($neg) = \
  $m_g($neg) = ??
 parm8=$m_g(0)\
  $m_g(0) = \
  $m_g(0) = ??
 parm9=$m_g($pos)\
  $m_g($pos) = \
  $m_g($pos) = ??
 parm10=$m_g '($neg)\
  $m_g '($neg) = \
  $m_g '($neg) = ??
 parm11=$m_g '(0)\
  $m_g '(0) = \
  $m_g '(0) = ??
 parm12=$m_g '($pos)\
  $m_g '($pos) = \
  $m_g '($pos) = ??

 !for i in 1,2,3, 7,8,9
  val$i=!randitem -4,-3,-2,-1,0,0,0,0,0,1,2,3,4
 !next i
 !for i in 4,5,6, 10,11,12
  val$i=!randitem -5,-4,-3,-2,-1,1,2,3,4,5
 !next i
 
 parmcnt=12
 anscnt=1
 minask=4
 t=!randitem 0,1
 !if $t=1
  !distribute item $neg,$pos into cent,ncent
  good1=$[($val1)*($val10)+($val4)*($val7)]
  !distribute item 1,0,0, 1,0,0, 1,0,0, 1,0,0 into weight1, weight2,\
 	weight3, weight4, weight5, weight6, weight7, weight8,\
	weight9, weight10, weight11, weight12
  !ifval $val1=0
   weight10=0
   minask=$[$minask-1]
  !endif
  !ifval $val10=0 and $val1!=0
   weight1=0
   minask=$[$minask-1]
  !endif
  !ifval $val4=0
   weight7=0
   minask=$[$minask-1]
  !endif
  !ifval $val7=0 and $val4!=0
   weight4=0
   minask=$[$minask-1]
  !endif
 !else
  !distribute item $pos,$neg into cent,ncent
  good1=$[($val3)*($val12)+($val6)*($val9)]
  !distribute item 0,0,1, 0,0,1, 0,0,1, 0,0,1 into weight1, weight2,\
 	weight3, weight4, weight5, weight6, weight7, weight8,\
	weight9, weight10, weight11, weight12
  !ifval $val3=0
   weight12=0
   minask=$[$minask-1]
  !endif
  !ifval $val12=0 and $val3!=0
   weight1=0
   minask=$[$minask-1]
  !endif
  !ifval $val6=0
   weight9=0
   minask=$[$minask-1]
  !endif
  !ifval $val9=0 and $val6!=0
   weight6=0
   minask=$[$minask-1]
  !endif
 !endif
!exit

:info
!exit

:final
 !bound ans1 between integer -100 and 100 default ??
 !ifval $ans1=$good1
  thisscore=1
 !endif
!exit

