math-exercises 3.0.56 → 3.0.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts +2 -0
  2. package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/operations/operationsPriorities.js +46 -36
  4. package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.d.ts.map +1 -1
  5. package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.js +65 -13
  6. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  7. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +1 -4
  8. package/lib/exercises/math/calculLitteral/factorisation/facto1.d.ts +16 -0
  9. package/lib/exercises/math/calculLitteral/factorisation/facto1.d.ts.map +1 -0
  10. package/lib/exercises/math/calculLitteral/factorisation/facto1.js +184 -0
  11. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
  12. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +43 -0
  13. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -1
  14. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  15. package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -1
  16. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts.map +1 -1
  17. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.js +23 -0
  18. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.d.ts.map +1 -1
  19. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.js +23 -0
  20. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts.map +1 -1
  21. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +49 -0
  22. package/lib/exercises/math/conversion/capacityConversion.d.ts.map +1 -1
  23. package/lib/exercises/math/conversion/capacityConversion.js +68 -12
  24. package/lib/exercises/math/conversion/hoursToDecimal.d.ts.map +1 -1
  25. package/lib/exercises/math/conversion/hoursToDecimal.js +73 -15
  26. package/lib/exercises/math/conversion/lengthConversion.d.ts.map +1 -1
  27. package/lib/exercises/math/conversion/lengthConversion.js +55 -6
  28. package/lib/exercises/math/conversion/massConversion.d.ts.map +1 -1
  29. package/lib/exercises/math/conversion/massConversion.js +72 -16
  30. package/lib/exercises/math/conversion/volumeConversion.d.ts.map +1 -1
  31. package/lib/exercises/math/conversion/volumeConversion.js +72 -12
  32. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts +8 -0
  33. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts.map +1 -0
  34. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.js +102 -0
  35. package/lib/exercises/math/derivation/convexity/convexityTrinomials.d.ts +7 -0
  36. package/lib/exercises/math/derivation/convexity/convexityTrinomials.d.ts.map +1 -0
  37. package/lib/exercises/math/derivation/convexity/convexityTrinomials.js +52 -0
  38. package/lib/exercises/math/derivation/convexity/index.d.ts +4 -0
  39. package/lib/exercises/math/derivation/convexity/index.d.ts.map +1 -0
  40. package/lib/exercises/math/derivation/convexity/index.js +3 -0
  41. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.d.ts +7 -0
  42. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.d.ts.map +1 -0
  43. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.js +134 -0
  44. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts +8 -0
  45. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -0
  46. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +79 -0
  47. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts +8 -0
  48. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts.map +1 -0
  49. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +85 -0
  50. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts +8 -0
  51. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts.map +1 -0
  52. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.js +86 -0
  53. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts +8 -0
  54. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts.map +1 -0
  55. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.js +76 -0
  56. package/lib/exercises/math/derivation/derivative/exp/index.d.ts +6 -0
  57. package/lib/exercises/math/derivation/derivative/exp/index.d.ts.map +1 -0
  58. package/lib/exercises/math/derivation/derivative/exp/index.js +5 -0
  59. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.d.ts +7 -0
  60. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.d.ts.map +1 -0
  61. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.js +84 -0
  62. package/lib/exercises/math/derivation/derivative/index.d.ts +6 -27
  63. package/lib/exercises/math/derivation/derivative/index.d.ts.map +1 -1
  64. package/lib/exercises/math/derivation/derivative/index.js +6 -27
  65. package/lib/exercises/math/derivation/derivative/ln/index.d.ts +4 -0
  66. package/lib/exercises/math/derivation/derivative/ln/index.d.ts.map +1 -0
  67. package/lib/exercises/math/derivation/derivative/ln/index.js +3 -0
  68. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.d.ts +8 -0
  69. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.d.ts.map +1 -0
  70. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.js +81 -0
  71. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.d.ts +8 -0
  72. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.d.ts.map +1 -0
  73. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.js +103 -0
  74. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.d.ts +8 -0
  75. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.d.ts.map +1 -0
  76. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.js +77 -0
  77. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts +10 -0
  78. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts.map +1 -0
  79. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.js +71 -0
  80. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts +11 -0
  81. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts.map +1 -0
  82. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.js +88 -0
  83. package/lib/exercises/math/derivation/derivative/polynomial/index.d.ts +8 -0
  84. package/lib/exercises/math/derivation/derivative/polynomial/index.d.ts.map +1 -0
  85. package/lib/exercises/math/derivation/derivative/polynomial/index.js +7 -0
  86. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts +10 -0
  87. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts.map +1 -0
  88. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.js +115 -0
  89. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.d.ts +10 -0
  90. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.d.ts.map +1 -0
  91. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.js +80 -0
  92. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.d.ts +9 -0
  93. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.d.ts.map +1 -0
  94. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.js +67 -0
  95. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts +10 -0
  96. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts.map +1 -0
  97. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.js +134 -0
  98. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.d.ts +11 -0
  99. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.d.ts.map +1 -0
  100. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.js +97 -0
  101. package/lib/exercises/math/derivation/derivative/power/index.d.ts +3 -0
  102. package/lib/exercises/math/derivation/derivative/power/index.d.ts.map +1 -0
  103. package/lib/exercises/math/derivation/derivative/power/index.js +2 -0
  104. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.d.ts +9 -0
  105. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.d.ts.map +1 -0
  106. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.js +122 -0
  107. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.d.ts +8 -0
  108. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.d.ts.map +1 -0
  109. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.js +118 -0
  110. package/lib/exercises/math/derivation/derivative/sqrt/index.d.ts +3 -0
  111. package/lib/exercises/math/derivation/derivative/sqrt/index.d.ts.map +1 -0
  112. package/lib/exercises/math/derivation/derivative/sqrt/index.js +3 -0
  113. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.d.ts +7 -0
  114. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.d.ts.map +1 -0
  115. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.js +115 -0
  116. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts +8 -0
  117. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts.map +1 -0
  118. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.js +77 -0
  119. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.d.ts +8 -0
  120. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.d.ts.map +1 -0
  121. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.js +85 -0
  122. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.d.ts +8 -0
  123. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.d.ts.map +1 -0
  124. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.js +81 -0
  125. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.d.ts +7 -0
  126. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.d.ts.map +1 -0
  127. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.js +103 -0
  128. package/lib/exercises/math/derivation/derivative/trigo/index.d.ts +5 -0
  129. package/lib/exercises/math/derivation/derivative/trigo/index.d.ts.map +1 -0
  130. package/lib/exercises/math/derivation/derivative/trigo/index.js +4 -0
  131. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.d.ts +8 -0
  132. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.d.ts.map +1 -0
  133. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.js +70 -0
  134. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.d.ts +7 -0
  135. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.d.ts.map +1 -0
  136. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.js +91 -0
  137. package/lib/exercises/math/derivation/derivativeNumberCalcul.d.ts.map +1 -1
  138. package/lib/exercises/math/derivation/derivativeNumberCalcul.js +4 -2
  139. package/lib/exercises/math/derivation/index.d.ts +2 -0
  140. package/lib/exercises/math/derivation/index.d.ts.map +1 -1
  141. package/lib/exercises/math/derivation/index.js +2 -0
  142. package/lib/exercises/math/derivation/variations/index.d.ts +2 -0
  143. package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -0
  144. package/lib/exercises/math/derivation/variations/index.js +1 -0
  145. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.d.ts +11 -0
  146. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.d.ts.map +1 -0
  147. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.js +168 -0
  148. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.d.ts.map +1 -1
  149. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.js +39 -22
  150. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
  151. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +7 -1
  152. package/lib/exercises/math/equaDiff/equaDiffGeneralForme.d.ts.map +1 -1
  153. package/lib/exercises/math/equaDiff/equaDiffGeneralForme.js +38 -15
  154. package/lib/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.d.ts.map +1 -1
  155. package/lib/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.js +29 -8
  156. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts +8 -0
  157. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts.map +1 -0
  158. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.js +86 -0
  159. package/lib/exercises/math/equaDiff/index.d.ts +1 -1
  160. package/lib/exercises/math/equaDiff/index.d.ts.map +1 -1
  161. package/lib/exercises/math/equaDiff/index.js +1 -1
  162. package/lib/exercises/math/functions/affines/signFunction.d.ts.map +1 -1
  163. package/lib/exercises/math/functions/affines/signFunction.js +23 -11
  164. package/lib/exercises/math/functions/exponential/expEquation.d.ts.map +1 -1
  165. package/lib/exercises/math/functions/exponential/expEquation.js +3 -0
  166. package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
  167. package/lib/exercises/math/functions/exponential/expFactorization.js +3 -0
  168. package/lib/exercises/math/functions/exponential/expSimplifiying.d.ts.map +1 -1
  169. package/lib/exercises/math/functions/exponential/expSimplifiying.js +83 -45
  170. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -1
  171. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +12 -5
  172. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.d.ts +2 -0
  173. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.d.ts.map +1 -0
  174. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.js +63 -0
  175. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts.map +1 -1
  176. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +68 -29
  177. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.d.ts.map +1 -1
  178. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.js +56 -4
  179. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.d.ts.map +1 -1
  180. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.js +71 -25
  181. package/lib/exercises/math/limits/polynomLimit.d.ts +1 -1
  182. package/lib/exercises/math/limits/polynomLimit.d.ts.map +1 -1
  183. package/lib/exercises/math/limits/polynomLimit.js +28 -9
  184. package/lib/exercises/math/limits/polynomLimitNoFI.d.ts +1 -1
  185. package/lib/exercises/math/limits/polynomLimitNoFI.d.ts.map +1 -1
  186. package/lib/exercises/math/limits/polynomLimitNoFI.js +29 -10
  187. package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
  188. package/lib/exercises/math/powers/calculateNegativePower.js +59 -16
  189. package/lib/exercises/math/powers/decimalToScientific.d.ts.map +1 -1
  190. package/lib/exercises/math/powers/decimalToScientific.js +55 -11
  191. package/lib/exercises/math/powers/index.d.ts +1 -0
  192. package/lib/exercises/math/powers/index.d.ts.map +1 -1
  193. package/lib/exercises/math/powers/index.js +1 -0
  194. package/lib/exercises/math/powers/powersDivision.d.ts +5 -2
  195. package/lib/exercises/math/powers/powersDivision.d.ts.map +1 -1
  196. package/lib/exercises/math/powers/powersDivision.js +68 -53
  197. package/lib/exercises/math/powers/powersMixOperations.d.ts +1 -0
  198. package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -1
  199. package/lib/exercises/math/powers/powersMixOperations.js +88 -17
  200. package/lib/exercises/math/powers/powersOfTenMixOperations.d.ts +10 -0
  201. package/lib/exercises/math/powers/powersOfTenMixOperations.d.ts.map +1 -0
  202. package/lib/exercises/math/powers/powersOfTenMixOperations.js +129 -0
  203. package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
  204. package/lib/exercises/math/powers/powersOfTenToDecimal.js +32 -3
  205. package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
  206. package/lib/exercises/math/powers/powersProduct.js +1 -0
  207. package/lib/exercises/math/powers/scientificToDecimal.d.ts.map +1 -1
  208. package/lib/exercises/math/powers/scientificToDecimal.js +50 -10
  209. package/lib/exercises/math/primitive/klogUPrimitive.js +1 -1
  210. package/lib/exercises/math/primitive/logarithmePrimitive.js +1 -1
  211. package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
  212. package/lib/exercises/math/primitive/polynomialPrimitive.js +1 -0
  213. package/lib/exercises/math/probaStat/stats1var/averageList.d.ts.map +1 -1
  214. package/lib/exercises/math/probaStat/stats1var/averageList.js +4 -4
  215. package/lib/exercises/math/probaStat/stats1var/averageWithTable.d.ts.map +1 -1
  216. package/lib/exercises/math/probaStat/stats1var/averageWithTable.js +42 -11
  217. package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.d.ts.map +1 -1
  218. package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.js +8 -20
  219. package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts.map +1 -1
  220. package/lib/exercises/math/probaStat/stats1var/etendueList.js +4 -6
  221. package/lib/exercises/math/probaStat/stats1var/interquartilesList.d.ts.map +1 -1
  222. package/lib/exercises/math/probaStat/stats1var/interquartilesList.js +4 -4
  223. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.d.ts.map +1 -1
  224. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.js +4 -4
  225. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
  226. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +13 -9
  227. package/lib/exercises/math/probaStat/stats1var/median.d.ts.map +1 -1
  228. package/lib/exercises/math/probaStat/stats1var/median.js +19 -14
  229. package/lib/exercises/math/probaStat/stats1var/medianList.d.ts.map +1 -1
  230. package/lib/exercises/math/probaStat/stats1var/medianList.js +3 -0
  231. package/lib/exercises/math/probaStat/stats1var/quartiles.d.ts.map +1 -1
  232. package/lib/exercises/math/probaStat/stats1var/quartiles.js +16 -11
  233. package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
  234. package/lib/exercises/math/probaStat/stats1var/quartilesList.js +18 -14
  235. package/lib/exercises/math/probaStat/stats1var/standardDeviationList.d.ts.map +1 -1
  236. package/lib/exercises/math/probaStat/stats1var/standardDeviationList.js +4 -4
  237. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.d.ts.map +1 -1
  238. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.js +4 -4
  239. package/lib/exercises/math/probaStat/stats1var/varianceList.d.ts.map +1 -1
  240. package/lib/exercises/math/probaStat/stats1var/varianceList.js +4 -4
  241. package/lib/exercises/math/probaStat/stats1var/varianceTable.d.ts.map +1 -1
  242. package/lib/exercises/math/probaStat/stats1var/varianceTable.js +4 -4
  243. package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts.map +1 -1
  244. package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.js +40 -2
  245. package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.d.ts.map +1 -1
  246. package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.js +32 -0
  247. package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
  248. package/lib/exercises/math/trigonometry/trigonometry.js +67 -1
  249. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
  250. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +89 -0
  251. package/lib/exercises/pc/index.d.ts +5 -5
  252. package/lib/exercises/pc/index.d.ts.map +1 -1
  253. package/lib/exercises/pc/index.js +5 -5
  254. package/lib/index.d.ts +56 -45
  255. package/lib/index.d.ts.map +1 -1
  256. package/lib/math/geometry/angle.d.ts.map +1 -1
  257. package/lib/math/geometry/angle.js +0 -5
  258. package/lib/math/geometry/vector.d.ts +1 -0
  259. package/lib/math/geometry/vector.d.ts.map +1 -1
  260. package/lib/math/geometry/vector.js +19 -0
  261. package/lib/math/numbers/decimals/decimal.d.ts +1 -0
  262. package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
  263. package/lib/math/numbers/decimals/decimal.js +2 -0
  264. package/lib/math/systems/generalSystem.d.ts +6 -1
  265. package/lib/math/systems/generalSystem.d.ts.map +1 -1
  266. package/lib/math/systems/generalSystem.js +137 -0
  267. package/lib/math/utils/arithmetic/lcm.js +1 -1
  268. package/lib/playground.d.ts.map +1 -1
  269. package/lib/playground.js +4 -34
  270. package/lib/tree/nodes/algebraicNode.d.ts +1 -0
  271. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  272. package/lib/tree/nodes/equations/equalNode.d.ts +7 -1
  273. package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
  274. package/lib/tree/nodes/equations/equalNode.js +17 -9
  275. package/lib/tree/nodes/functions/logNode.js +2 -4
  276. package/lib/tree/nodes/operators/addNode.js +1 -1
  277. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  278. package/lib/tree/nodes/operators/fractionNode.js +35 -11
  279. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  280. package/lib/tree/nodes/operators/multiplyNode.js +4 -3
  281. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  282. package/lib/tree/nodes/operators/powerNode.js +5 -0
  283. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  284. package/lib/tree/nodes/sets/intervalNode.js +3 -1
  285. package/lib/tree/parsers/latexParser.js +6 -2
  286. package/package.json +1 -1
@@ -0,0 +1,134 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Polynomial } from "../../../../../math/polynomials/polynomial.js";
4
+ import { randint } from "../../../../../math/utils/random/randint.js";
5
+ import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
6
+ import { power } from "../../../../../tree/nodes/operators/powerNode.js";
7
+ import { polynomialParser } from "../../../../../tree/parsers/polynomialParser.js";
8
+ import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
9
+ const getHint = (identifiers) => {
10
+ return `Dérive chacun des termes de la somme, puis additionne les dérivées obtenues.
11
+
12
+ On rappelle que la dérivée de la fonction $kx^n$ est :
13
+
14
+ $$
15
+ k\\times n \\times x^{n-1}
16
+ $$`;
17
+ };
18
+ const getCorrection = (identifiers) => {
19
+ const monoms = identifiers.coefficients
20
+ .map((c, i) => multiply(c, power("x", i)).simplify())
21
+ .filter((n) => n.evaluate() !== 0);
22
+ const answer = getAnswer(identifiers);
23
+ return `On dérive chacun des termes de la somme :
24
+
25
+ ${monoms
26
+ .reverse()
27
+ .map((n) => `- $${n.toTex()} \\to ${n.derivative().simplify().toTex()}$`)
28
+ .join(" \n ")}
29
+
30
+ Puis, on additionne ces résultats pour obtenir la dérivée de la fonction $f$ :
31
+
32
+ $$
33
+ f'(x) = ${answer}
34
+ $$
35
+ `;
36
+ };
37
+ const getInstruction = (identifiers) => {
38
+ const polynomial = new Polynomial(identifiers.coefficients);
39
+ return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par :
40
+
41
+ $$
42
+ f(x) = ${polynomial.toTree().toTex()}
43
+ $$`;
44
+ };
45
+ const getAnswer = (identifiers) => {
46
+ const polynomial = new Polynomial(identifiers.coefficients);
47
+ const derivative = polynomial.derivate();
48
+ return derivative.toTree().toTex();
49
+ };
50
+ export const getThirdDegreeDerivative = () => {
51
+ const coefficients = [];
52
+ for (let i = 1; i <= 3; i++)
53
+ coefficients.push(randint(-9, 10));
54
+ coefficients.push(randint(-9, 10, [0]));
55
+ const identifiers = { coefficients };
56
+ const question = {
57
+ instruction: getInstruction(identifiers),
58
+ startStatement: `f'(x)`,
59
+ answer: getAnswer(identifiers),
60
+ keys: ["x"],
61
+ answerFormat: "tex",
62
+ identifiers,
63
+ hint: getHint(identifiers),
64
+ correction: getCorrection(identifiers),
65
+ };
66
+ return question;
67
+ };
68
+ export const getThirdDegreeDerivativePropositions = (n, { answer, coefficients }) => {
69
+ const propositions = [];
70
+ addValidProp(propositions, answer);
71
+ if (coefficients[2] !== 0)
72
+ tryToAddWrongProp(propositions, new Polynomial([coefficients[0], coefficients[1], coefficients[2]])
73
+ .toTree()
74
+ .toTex());
75
+ if (coefficients[2] !== 0)
76
+ tryToAddWrongProp(propositions, new Polynomial([
77
+ coefficients[0] + coefficients[1],
78
+ coefficients[1],
79
+ coefficients[2],
80
+ ])
81
+ .toTree()
82
+ .toTex());
83
+ while (propositions.length < n) {
84
+ const randomCoefficients = [];
85
+ for (let j = 1; j <= 3; j++)
86
+ randomCoefficients.push(randint(-9, 10));
87
+ randomCoefficients.push(randint(-9, 10, [0]));
88
+ const randomPolynomial = new Polynomial(randomCoefficients);
89
+ tryToAddWrongProp(propositions, randomPolynomial.derivate().toTree().toTex());
90
+ }
91
+ return shuffleProps(propositions, n);
92
+ };
93
+ export const isThirdDegreeDerivativeAnswerValid = (ans, { answer, coefficients }) => {
94
+ try {
95
+ const parsed = polynomialParser(ans);
96
+ if (!parsed)
97
+ return false;
98
+ const simp = parsed.simplify({
99
+ forbidFactorize: true,
100
+ towardsDistribute: true,
101
+ });
102
+ return simp.toTex() === answer;
103
+ }
104
+ catch (err) {
105
+ return handleVEAError(err);
106
+ }
107
+ };
108
+ export const thirdDegreeDerivative = {
109
+ id: "thirdDegreeDerivative",
110
+ connector: "=",
111
+ label: "Dérivée d'un polynôme de degré $3$",
112
+ levels: [
113
+ "1reESM",
114
+ "1reSpé",
115
+ "1reTech",
116
+ "MathComp",
117
+ "1rePro",
118
+ "TermPro",
119
+ "TermTech",
120
+ ],
121
+ sections: ["Dérivation"],
122
+ isSingleStep: false,
123
+ generator: (nb) => getDistinctQuestions(getThirdDegreeDerivative, nb),
124
+ qcmTimer: 60,
125
+ freeTimer: 60,
126
+ getPropositions: getThirdDegreeDerivativePropositions,
127
+ isAnswerValid: isThirdDegreeDerivativeAnswerValid,
128
+ subject: "Mathématiques",
129
+ getInstruction,
130
+ getHint,
131
+ getAnswer,
132
+ getCorrection,
133
+ hasHintAndCorrection: true,
134
+ };
@@ -0,0 +1,11 @@
1
+ import { Exercise } from "../../../../exercise.js";
2
+ type Identifiers = {
3
+ type: number;
4
+ a?: number;
5
+ b?: number;
6
+ coefficients?: number[];
7
+ tex?: string;
8
+ };
9
+ export declare const usualDerivative: Exercise<Identifiers>;
10
+ export {};
11
+ //# sourceMappingURL=usualderivative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usualderivative.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/polynomial/usualderivative.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAMT,MAAM,yBAAyB,CAAC;AAuBjC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AA0FF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAYjD,CAAC"}
@@ -0,0 +1,97 @@
1
+ import { randint } from "../../../../../math/utils/random/randint.js";
2
+ import { getDistinctQuestions } from "../../../../utils/getDistinctQuestions.js";
3
+ import { getConstanteDerivative, getConstanteDerivativePropositions, isConstanteDerivativeAnswerValid, } from "./constanteDerivative.js";
4
+ import { getFirstDegreeDerivative, getFirstDegreeDerivativePropositions, isFirstDegreeDerivativeAnswerValid, } from "./firstDegreeDerivative.js";
5
+ import { getSecondDegreeDerivative, getSecondDegreeDerivativePropositions, isSecondDegreeDerivativeAnswerValid, } from "./secondDegreeDerivative.js";
6
+ import { getThirdDegreeDerivative, getThirdDegreeDerivativePropositions, isThirdDegreeDerivativeAnswerValid, } from "./thirdDegreeDerivative.js";
7
+ const getUsualDerivative = () => {
8
+ const type = randint(1, 5);
9
+ let question;
10
+ let identifiers;
11
+ switch (type) {
12
+ case 1:
13
+ question = getFirstDegreeDerivative();
14
+ identifiers = { ...question.identifiers, type: 1 };
15
+ break;
16
+ case 2:
17
+ question = getSecondDegreeDerivative();
18
+ identifiers = { ...question.identifiers, type: 2 };
19
+ break;
20
+ case 3:
21
+ question = getThirdDegreeDerivative();
22
+ identifiers = { ...question.identifiers, type: 3 };
23
+ break;
24
+ case 4:
25
+ question = getConstanteDerivative();
26
+ identifiers = { ...question.identifiers, type: 4 };
27
+ break;
28
+ default:
29
+ throw Error("erreur");
30
+ }
31
+ return { ...question, identifiers };
32
+ };
33
+ const getPropositions = (n, { answer, type, a, b, coefficients, tex }) => {
34
+ let props;
35
+ switch (type) {
36
+ case 1:
37
+ props = getFirstDegreeDerivativePropositions(n, { a: a, answer, b: b });
38
+ break;
39
+ case 2:
40
+ props = getSecondDegreeDerivativePropositions(n, {
41
+ answer,
42
+ coefficients: coefficients,
43
+ });
44
+ break;
45
+ case 3:
46
+ props = getThirdDegreeDerivativePropositions(n, {
47
+ answer,
48
+ coefficients: coefficients,
49
+ });
50
+ break;
51
+ case 4:
52
+ props = getConstanteDerivativePropositions(n, { answer, tex: tex });
53
+ break;
54
+ default:
55
+ throw Error("erreur");
56
+ }
57
+ return props;
58
+ };
59
+ const isAnswerValid = (ans, { answer, type, coefficients, a, b, tex }) => {
60
+ let valid;
61
+ switch (type) {
62
+ case 1:
63
+ valid = isFirstDegreeDerivativeAnswerValid(ans, { answer, a: a, b: b });
64
+ break;
65
+ case 2:
66
+ valid = isSecondDegreeDerivativeAnswerValid(ans, {
67
+ coefficients: coefficients,
68
+ answer,
69
+ });
70
+ break;
71
+ case 3:
72
+ valid = isThirdDegreeDerivativeAnswerValid(ans, {
73
+ coefficients: coefficients,
74
+ answer,
75
+ });
76
+ break;
77
+ case 4:
78
+ valid = isConstanteDerivativeAnswerValid(ans, { answer, tex: tex });
79
+ break;
80
+ default:
81
+ throw Error("erreur");
82
+ }
83
+ return valid;
84
+ };
85
+ export const usualDerivative = {
86
+ id: "usualDerivative",
87
+ connector: "=",
88
+ label: "Dérivées des fonctions de référence",
89
+ isSingleStep: false,
90
+ generator: (nb) => getDistinctQuestions(getUsualDerivative, nb),
91
+ qcmTimer: 60,
92
+ freeTimer: 60,
93
+ getPropositions,
94
+ isAnswerValid,
95
+ subject: "Mathématiques",
96
+ hasHintAndCorrection: true,
97
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./powerCompositionDerivation.js";
2
+ export * from "./powerFunctionDerivative.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/power/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./powerCompositionDerivation.js";
2
+ export * from "./powerFunctionDerivative.js";
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ affineA: number;
4
+ affineB: number;
5
+ power: number;
6
+ };
7
+ export declare const powerCompositionDerivation: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=powerCompositionDerivation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"powerCompositionDerivation.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/power/powerCompositionDerivation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAqIF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAmB5D,CAAC"}
@@ -0,0 +1,122 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Affine, AffineConstructor } from "../../../../../math/polynomials/affine.js";
4
+ import { randint } from "../../../../../math/utils/random/randint.js";
5
+ import { MultiplyNode, multiply, } from "../../../../../tree/nodes/operators/multiplyNode.js";
6
+ import { PowerNode, power } from "../../../../../tree/nodes/operators/powerNode.js";
7
+ import { substract } from "../../../../../tree/nodes/operators/substractNode.js";
8
+ import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
9
+ import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
10
+ import { alignTex } from "../../../../../utils/latex/alignTex.js";
11
+ const getInstruction = (identifiers) => {
12
+ const { affineA, affineB, power } = identifiers;
13
+ const affine = new Affine(affineA, affineB);
14
+ const powerTree = power.toTree();
15
+ const affineTree = affine.toTree();
16
+ const fct = new PowerNode(affineTree, powerTree);
17
+ return `Déterminer la fonction dérivée de la fonction $f$ définie par :
18
+
19
+ $$
20
+ f(x) = ${fct.toTex()}
21
+ $$`;
22
+ };
23
+ const getAnswer = (identifiers) => {
24
+ const { affineA, affineB, power } = identifiers;
25
+ const affine = new Affine(affineA, affineB);
26
+ const affineTree = affine.toTree();
27
+ const deriv = new MultiplyNode((power * affine.a).toTree(), new PowerNode(affineTree, (power - 1).toTree()));
28
+ return deriv.toTex();
29
+ };
30
+ const getHint = (identifiers) => {
31
+ return `On rappelle la règle de dérivation suivante :
32
+
33
+ $$
34
+ \\left(u^n \\right)' = n \\times u' \\times u^{n-1}
35
+ $$
36
+ `;
37
+ };
38
+ const getCorrection = (identifiers) => {
39
+ const { affineA, affineB, power: pow } = identifiers;
40
+ const affine = new Affine(affineA, affineB).toTree();
41
+ const affineTex = affine.toTex();
42
+ const answer = getAnswer(identifiers);
43
+ return `On sait que :
44
+
45
+ $$
46
+ \\left(u^n \\right)' = n \\times u' \\times u^{n-1}
47
+ $$
48
+
49
+ Ici, on a $n = ${pow}$, et $u(x) = ${affineTex}$, donc $u'(x) = ${affineA}$.
50
+
51
+ Ainsi,
52
+
53
+ ${alignTex([
54
+ [
55
+ "f'(x)",
56
+ "=",
57
+ multiply(pow, multiply(affineA, power(affine, substract(pow, 1)))).toTex(),
58
+ ],
59
+ ["", "=", answer],
60
+ ])}
61
+ `;
62
+ };
63
+ const getPowerCompositionDerivationQuestion = () => {
64
+ const affine = AffineConstructor.random(undefined, { excludes: [0] });
65
+ const power = randint(3, 10);
66
+ const identifiers = { affineA: affine.a, affineB: affine.b, power };
67
+ const question = {
68
+ answer: getAnswer(identifiers),
69
+ instruction: getInstruction(identifiers),
70
+ hint: getHint(identifiers),
71
+ correction: getCorrection(identifiers),
72
+ keys: ["x"],
73
+ answerFormat: "tex",
74
+ identifiers,
75
+ };
76
+ return question;
77
+ };
78
+ const getPropositions = (n, { answer, affineA, affineB, power }) => {
79
+ const propositions = [];
80
+ const affineTree = new Affine(affineA, affineB).toTree();
81
+ addValidProp(propositions, answer);
82
+ const powerN = new PowerNode(affineTree, power.toTree());
83
+ const powerNMinusOne = new PowerNode(affineTree, (power - 1).toTree());
84
+ tryToAddWrongProp(propositions, new MultiplyNode(power.toTree(), powerNMinusOne).toTex());
85
+ tryToAddWrongProp(propositions, new MultiplyNode(affineA.toTree(), powerN).toTex());
86
+ tryToAddWrongProp(propositions, new MultiplyNode(affineA.toTree(), powerNMinusOne).toTex());
87
+ tryToAddWrongProp(propositions, new MultiplyNode((power * affineA).toTree(), powerN).toTex());
88
+ while (propositions.length < n) {
89
+ tryToAddWrongProp(propositions, new MultiplyNode(randint(-10, 10).toTree(), powerN).toTex());
90
+ }
91
+ return shuffleProps(propositions, n);
92
+ };
93
+ const isAnswerValid = (ans, { answer, power, affineA, affineB }) => {
94
+ try {
95
+ const parsed = parseAlgebraic(ans);
96
+ if (!parsed)
97
+ return false;
98
+ return parsed.simplify({ forbidFactorize: true }).toTex() === answer;
99
+ }
100
+ catch (err) {
101
+ return handleVEAError(err);
102
+ }
103
+ };
104
+ export const powerCompositionDerivation = {
105
+ id: "powerCompositionDerivation",
106
+ connector: "=",
107
+ label: "Dérivée de $\\left(ax+b\\right)^n$",
108
+ levels: ["1reSpé"],
109
+ isSingleStep: true,
110
+ sections: ["Dérivation"],
111
+ generator: (nb) => getDistinctQuestions(getPowerCompositionDerivationQuestion, nb),
112
+ qcmTimer: 60,
113
+ freeTimer: 60,
114
+ getPropositions,
115
+ isAnswerValid,
116
+ subject: "Mathématiques",
117
+ getAnswer,
118
+ getInstruction,
119
+ getHint,
120
+ getCorrection,
121
+ hasHintAndCorrection: true,
122
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ a: number;
4
+ power: number;
5
+ };
6
+ export declare const powerFunctionDerivative: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=powerFunctionDerivative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"powerFunctionDerivative.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/power/powerFunctionDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAsJF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAiBzD,CAAC"}
@@ -0,0 +1,118 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randint } from "../../../../../math/utils/random/randint.js";
4
+ import { NumberNode } from "../../../../../tree/nodes/numbers/numberNode.js";
5
+ import { MultiplyNode } from "../../../../../tree/nodes/operators/multiplyNode.js";
6
+ import { PowerNode } from "../../../../../tree/nodes/operators/powerNode.js";
7
+ import { VariableNode } from "../../../../../tree/nodes/variables/variableNode.js";
8
+ import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
9
+ import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
10
+ import { alignTex } from "../../../../../utils/latex/alignTex.js";
11
+ const getHint = (identifiers) => {
12
+ return `On rappelle que la dérivée de la fonction $kx^n$ est :
13
+
14
+ $$
15
+ k\\times n \\times x^{n-1}
16
+ $$`;
17
+ };
18
+ const getCorrection = (identifiers) => {
19
+ const { a, power } = identifiers;
20
+ return `La dérivée de la fonction $kx^n$ est :
21
+
22
+ $$
23
+ k\\times n \\times x^{n-1}
24
+ $$
25
+
26
+ Ici, on a $k = ${a}$ et $n = ${power}$.
27
+
28
+ On obtient donc :
29
+
30
+ ${alignTex([
31
+ ["f'(x)", "=", `${a} \\times ${power} \\times x^{${power}-1}`],
32
+ ["", "=", getAnswer(identifiers)],
33
+ ])}`;
34
+ };
35
+ const getInstruction = (identifiers) => {
36
+ const { a, power } = identifiers;
37
+ const statement = new MultiplyNode(new NumberNode(a), new PowerNode(new VariableNode("x"), new NumberNode(power)));
38
+ return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par :
39
+
40
+ $$
41
+ f(x)=${statement.toTex()}
42
+ $$`;
43
+ };
44
+ const getAnswer = (identifiers) => {
45
+ const { a, power } = identifiers;
46
+ const answerStatement = power > 2
47
+ ? new MultiplyNode(new NumberNode(a * power), new PowerNode(new VariableNode("x"), new NumberNode(power - 1)))
48
+ : new MultiplyNode(new NumberNode(a * power), new VariableNode("x"));
49
+ const answer = answerStatement.toTex();
50
+ return answer;
51
+ };
52
+ const getPowerFunctionDerivative = () => {
53
+ const a = randint(-9, 10, [0]);
54
+ const power = randint(2, 10);
55
+ const identifiers = { a, power };
56
+ const question = {
57
+ instruction: getInstruction(identifiers),
58
+ startStatement: `f'(x)`,
59
+ answer: getAnswer(identifiers),
60
+ keys: ["x"],
61
+ answerFormat: "tex",
62
+ identifiers,
63
+ hint: getHint(identifiers),
64
+ correction: getCorrection(identifiers),
65
+ };
66
+ return question;
67
+ };
68
+ const getPropositions = (n, { answer, a, power }) => {
69
+ const propositions = [];
70
+ addValidProp(propositions, answer);
71
+ if (power === 2)
72
+ tryToAddWrongProp(propositions, new MultiplyNode(new NumberNode(a), new VariableNode("x")).toTex());
73
+ if (power > 2)
74
+ tryToAddWrongProp(propositions, new MultiplyNode(new NumberNode(a), new PowerNode(new VariableNode("x"), new NumberNode(power - 1))).toTex());
75
+ tryToAddWrongProp(propositions, new MultiplyNode(new NumberNode(a * power), new PowerNode(new VariableNode("x"), new NumberNode(power))).toTex());
76
+ if (a !== 1)
77
+ tryToAddWrongProp(propositions, new MultiplyNode(new NumberNode(a - 1), new PowerNode(new VariableNode("x"), new NumberNode(power))).toTex());
78
+ while (propositions.length < n) {
79
+ const wrongExponent = randint(2, 10);
80
+ if (wrongExponent === 2) {
81
+ tryToAddWrongProp(propositions, new MultiplyNode(new NumberNode(a * wrongExponent), new VariableNode("x")).toTex());
82
+ }
83
+ else {
84
+ tryToAddWrongProp(propositions, new MultiplyNode(new NumberNode(a * wrongExponent), new PowerNode(new VariableNode("x"), new NumberNode(wrongExponent - 1))).toTex());
85
+ }
86
+ }
87
+ return shuffleProps(propositions, n);
88
+ };
89
+ const isAnswerValid = (ans, { answer, a, power }) => {
90
+ try {
91
+ const parsed = parseAlgebraic(ans);
92
+ if (!parsed)
93
+ return false;
94
+ return (parsed
95
+ .simplify({ towardsDistribute: true, forbidFactorize: true })
96
+ .toTex() === answer);
97
+ }
98
+ catch (err) {
99
+ return handleVEAError(err);
100
+ }
101
+ };
102
+ export const powerFunctionDerivative = {
103
+ id: "powerFunctionDerivative",
104
+ connector: "=",
105
+ label: "Dérivée d'une fonction monôme",
106
+ isSingleStep: false,
107
+ generator: (nb) => getDistinctQuestions(getPowerFunctionDerivative, nb),
108
+ getPropositions,
109
+ isAnswerValid,
110
+ qcmTimer: 60,
111
+ freeTimer: 60,
112
+ subject: "Mathématiques",
113
+ getInstruction,
114
+ getAnswer,
115
+ getHint,
116
+ getCorrection,
117
+ hasHintAndCorrection: true,
118
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./sqrtCompositionDerivation.js";
2
+ export * from "./rootFunctionDerivative.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/sqrt/index.ts"],"names":[],"mappings":"AACA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC"}
@@ -0,0 +1,3 @@
1
+ // export * from "./sqrtProductDerivative.js";
2
+ export * from "./sqrtCompositionDerivation.js";
3
+ export * from "./rootFunctionDerivative.js";
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ a: number;
4
+ };
5
+ export declare const rootFunctionDerivative: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=rootFunctionDerivative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rootFunctionDerivative.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+FF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAiBxD,CAAC"}
@@ -0,0 +1,115 @@
1
+ import { addValidProp, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randint } from "../../../../../math/utils/random/randint.js";
4
+ import { round } from "../../../../../math/utils/round.js";
5
+ import { sqrt } from "../../../../../tree/nodes/functions/sqrtNode.js";
6
+ import { frac } from "../../../../../tree/nodes/operators/fractionNode.js";
7
+ import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
8
+ import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
9
+ import { shuffle } from "../../../../../utils/alea/shuffle.js";
10
+ import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
11
+ import { alignTex } from "../../../../../utils/latex/alignTex.js";
12
+ const getStatementNode = (identifiers) => {
13
+ return multiply(identifiers.a, sqrt("x"));
14
+ };
15
+ const getInstruction = (identifiers) => {
16
+ return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par :
17
+
18
+ $$
19
+ f(x) = ${getStatementNode(identifiers).toTex()}
20
+ $$ `;
21
+ };
22
+ const getAnswer = (identifiers) => {
23
+ return frac(identifiers.a, multiply(2, sqrt("x")))
24
+ .simplify()
25
+ .toTex();
26
+ };
27
+ const getHint = (identifiers) => {
28
+ return `La dérivée sur $]0; +\\infty[$ de la fonction $f(x) =\\sqrt{x}$ est :
29
+
30
+ $$
31
+ f'(x) = \\frac{1}{2\\sqrt{x}}
32
+ $$`;
33
+ };
34
+ const getCorrection = (identifiers) => {
35
+ const statement = getStatementNode(identifiers);
36
+ const answer = getAnswer(identifiers);
37
+ const a = identifiers.a;
38
+ return `La dérivée sur $]0; +\\infty[$ de la fonction $\\sqrt{x}$ est :
39
+
40
+ $$
41
+ \\frac{1}{2\\sqrt{x}}
42
+ $$
43
+
44
+ Ici, on a $f(x) = ${statement.toTex()}$.
45
+
46
+ On a donc :
47
+
48
+ ${alignTex([
49
+ ["f'(x)", "=", multiply(a, frac(1, multiply(2, sqrt("x")))).toTex()],
50
+ ["", "=", answer],
51
+ ])}
52
+ `;
53
+ };
54
+ const getRootFunctionDerivative = () => {
55
+ const a = randint(-19, 20, [0, 1]);
56
+ const identifiers = { a };
57
+ const question = {
58
+ instruction: getInstruction(identifiers),
59
+ startStatement: `f'(x)`,
60
+ answer: getAnswer(identifiers),
61
+ keys: ["x"],
62
+ answerFormat: "tex",
63
+ identifiers,
64
+ hint: getHint(identifiers),
65
+ correction: getCorrection(identifiers),
66
+ };
67
+ return question;
68
+ };
69
+ const getPropositions = (n, { answer, a }) => {
70
+ const propositions = [];
71
+ addValidProp(propositions, answer);
72
+ tryToAddWrongProp(propositions, `\\frac{${a}}{\\sqrt(x)}`);
73
+ tryToAddWrongProp(propositions, `${a}`);
74
+ tryToAddWrongProp(propositions, `\\frac{${a}}{x}`);
75
+ while (propositions.length < n) {
76
+ const randomA = randint(-9, 10, [0]);
77
+ const isEvenA = randomA / 2 === round(randomA / 2, 0);
78
+ if (isEvenA) {
79
+ tryToAddWrongProp(propositions, `\\frac{${randomA / 2}}{\\sqrt{x}}`);
80
+ }
81
+ else {
82
+ tryToAddWrongProp(propositions, `\\frac{${randomA}}{2\\sqrt{x}}`);
83
+ }
84
+ }
85
+ return shuffle(propositions);
86
+ };
87
+ const isAnswerValid = (ans, { answer, a }) => {
88
+ try {
89
+ const parsed = parseAlgebraic(ans);
90
+ if (!parsed)
91
+ return false;
92
+ const simplified = parsed.simplify();
93
+ return simplified.toTex() === answer;
94
+ }
95
+ catch (err) {
96
+ return handleVEAError(err);
97
+ }
98
+ };
99
+ export const rootFunctionDerivative = {
100
+ id: "rootFunctionDerivative",
101
+ connector: "=",
102
+ label: "Dérivée d'une fonction racine carrée",
103
+ isSingleStep: false,
104
+ generator: (nb) => getDistinctQuestions(getRootFunctionDerivative, nb),
105
+ qcmTimer: 60,
106
+ freeTimer: 60,
107
+ getPropositions,
108
+ isAnswerValid,
109
+ subject: "Mathématiques",
110
+ getHint,
111
+ getCorrection,
112
+ getInstruction,
113
+ getAnswer,
114
+ hasHintAndCorrection: true,
115
+ };