math-exercises 3.0.178 → 3.0.179
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.
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts +14 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.js +283 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts +15 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.js +296 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +3 -3
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts +14 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.js +346 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts +15 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.js +435 -0
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts +13 -0
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.js +326 -0
- package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts +14 -0
- package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.js +181 -0
- package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts +10 -0
- package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.js +272 -0
- package/lib/exercises/math/derivation/problems/index.d.ts +5 -0
- package/lib/exercises/math/derivation/problems/index.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/index.js +4 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts +8 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.js +171 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts +15 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +328 -0
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts +13 -0
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.js +275 -0
- package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts +8 -0
- package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.js +137 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts +10 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.js +478 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts +10 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.js +499 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts +10 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.js +240 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts +12 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.js +436 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts +12 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.js +219 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts +13 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.js +273 -0
- package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts +18 -0
- package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.js +295 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts +13 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +388 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts +9 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.js +308 -0
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts +14 -0
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js +439 -0
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts +14 -0
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.js +547 -0
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts +15 -0
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.js +537 -0
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts +15 -0
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.js +639 -0
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts +14 -0
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.js +530 -0
- package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts +10 -0
- package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/signVarTableProductFExp.js +451 -0
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts +11 -0
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.js +514 -0
- package/lib/exercises/math/functions/composition/index.d.ts +0 -1
- package/lib/exercises/math/functions/composition/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/composition/index.js +1 -1
- package/lib/exercises/math/functions/exponential/algebraic/index.d.ts +0 -1
- package/lib/exercises/math/functions/exponential/algebraic/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/algebraic/index.js +1 -1
- package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.js +4 -11
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +32 -17
- package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts +13 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.js +195 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts +9 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.js +220 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts +15 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbability.js +332 -0
- package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts +8 -0
- package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.js +222 -0
- package/lib/exercises/math/probaStat/conditional/index.d.ts +5 -0
- package/lib/exercises/math/probaStat/conditional/index.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/index.js +4 -0
- package/lib/exercises/math/probaStat/index.d.ts +1 -2
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +1 -2
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts +1 -0
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +26 -199
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.js +6 -2
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +6 -5
- package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.js +4 -27
- package/lib/exercises/math/probaStat/twoEventsSituations.d.ts +29 -0
- package/lib/exercises/math/probaStat/twoEventsSituations.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/twoEventsSituations.js +145 -0
- package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts +4 -1
- package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/explicitFormulaUsage.js +47 -7
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.js +1 -1
- package/lib/exercises/math/sequences/geometric/index.d.ts +0 -3
- package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/index.js +3 -3
- package/lib/exercises/math/sequences/geometric/situations/index.d.ts +0 -1
- package/lib/exercises/math/sequences/geometric/situations/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/situations/index.js +1 -1
- package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts +5 -1
- package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/recurrenceFormulaUsage.js +89 -9
- package/lib/exercises/math/trigonometry/circle/associatePoint.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/circle/associatePoint.js +55 -6
- package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.js +5 -6
- package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.js +1 -3
- package/lib/exercises/vea/polynomialVEA.d.ts +2 -0
- package/lib/exercises/vea/polynomialVEA.d.ts.map +1 -0
- package/lib/exercises/vea/polynomialVEA.js +17 -0
- package/lib/exercises/vea/valueTableVEA.d.ts +8 -0
- package/lib/exercises/vea/valueTableVEA.d.ts.map +1 -0
- package/lib/exercises/vea/valueTableVEA.js +12 -0
- package/lib/index.d.ts +27 -47
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +1 -1
- package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts +19 -0
- package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts.map +1 -0
- package/lib/math/utils/polynomial/polynomialInterpolationUtils.js +53 -0
- package/lib/math/utils/polynomial/polynomialUtils.d.ts +37 -0
- package/lib/math/utils/polynomial/polynomialUtils.d.ts.map +1 -0
- package/lib/math/utils/polynomial/polynomialUtils.js +223 -0
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +6 -6
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +1 -1
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +2 -1
- package/lib/tree/utilities/nodeUtils.d.ts +6 -0
- package/lib/tree/utilities/nodeUtils.d.ts.map +1 -0
- package/lib/tree/utilities/nodeUtils.js +24 -0
- package/lib/utils/strings/prependArticle.d.ts +2 -0
- package/lib/utils/strings/prependArticle.d.ts.map +1 -0
- package/lib/utils/strings/prependArticle.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
import { GeneratorOptionType, GeneratorOptionTarget, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { varSignTableVEA } from "../../../../exercises/vea/varSignTableVEA.js";
|
|
4
|
+
import { InequationSymbol, } from "../../../../math/inequations/inequation.js";
|
|
5
|
+
import { AffineConstructor } from "../../../../math/polynomials/affine.js";
|
|
6
|
+
import { Trinom, TrinomConstructor } from "../../../../math/polynomials/trinom.js";
|
|
7
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
8
|
+
import { exp } from "../../../../tree/nodes/functions/expNode.js";
|
|
9
|
+
import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
|
|
10
|
+
import { InequationSolutionNode } from "../../../../tree/nodes/inequations/inequationSolutionNode.js";
|
|
11
|
+
import { MinusInfinityNode, PlusInfinityNode, } from "../../../../tree/nodes/numbers/infiniteNode.js";
|
|
12
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
13
|
+
import { isMultiplyNode, multiply, } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
14
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
15
|
+
import { ClosureType } from "../../../../tree/nodes/sets/closure.js";
|
|
16
|
+
import { IntervalNode } from "../../../../tree/nodes/sets/intervalNode.js";
|
|
17
|
+
import { isUnionIntervalNode, UnionIntervalNode, } from "../../../../tree/nodes/sets/unionIntervalNode.js";
|
|
18
|
+
import { zip } from "../../../../utils/arrays/arrayZip.js";
|
|
19
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
20
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
21
|
+
const _simplifyMore = (node) => {
|
|
22
|
+
if (isMultiplyNode(node)) {
|
|
23
|
+
const nodeLeft = node.leftChild;
|
|
24
|
+
const nodeRight = node.rightChild;
|
|
25
|
+
try {
|
|
26
|
+
return multiply(nodeLeft.simplify({ forbidFactorize: true, towardsDistribute: true }), nodeRight.simplify({ forbidFactorize: true, towardsDistribute: true }));
|
|
27
|
+
}
|
|
28
|
+
catch (_) {
|
|
29
|
+
return node;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
return node;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const getInstructionNode = (a, b, c) => {
|
|
37
|
+
const nodeF = getNodeF(a, b, c);
|
|
38
|
+
const nodeG = "x".toTree();
|
|
39
|
+
const nodeExpG = exp(nodeG);
|
|
40
|
+
return multiply(nodeF, nodeExpG);
|
|
41
|
+
};
|
|
42
|
+
const getNodeF = (a, b, c) => {
|
|
43
|
+
if (a !== undefined) {
|
|
44
|
+
return TrinomConstructor.fromCoeffs([c, b, a]).toTree().simplify();
|
|
45
|
+
}
|
|
46
|
+
else if (b !== undefined) {
|
|
47
|
+
return AffineConstructor.fromCoeffs([c, b]).toTree().simplify();
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return c.toTree();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const getRootNodesOfDerivative = (a, b, c) => {
|
|
54
|
+
//get coeffs
|
|
55
|
+
let coeffs;
|
|
56
|
+
if (a !== undefined) {
|
|
57
|
+
coeffs = zip([c, b, a], [b, 2 * a, 0]).map(([c1, c2]) => c1 + c2);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
coeffs = zip([c, b], [b, 0]).map(([c1, c2]) => c1 + c2);
|
|
61
|
+
}
|
|
62
|
+
//get roots
|
|
63
|
+
if (coeffs.length === 3) {
|
|
64
|
+
const trinom = TrinomConstructor.fromCoeffs(coeffs);
|
|
65
|
+
return trinom.getRootsNode();
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
const [c, b] = coeffs;
|
|
69
|
+
return [frac(opposite(c), b).simplify()];
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const getTrinomInequationSolutionNode = (coeffs, ineqType) => {
|
|
73
|
+
const [c, b, a] = coeffs;
|
|
74
|
+
const ineq = new InequationSymbol(ineqType);
|
|
75
|
+
const trinom = new Trinom(a, b, c);
|
|
76
|
+
const roots = trinom.getRootsNode();
|
|
77
|
+
const aPositive = a > 0;
|
|
78
|
+
const insideInterval = new IntervalNode(roots[0], roots[1], ineq.isStrict ? ClosureType.OO : ClosureType.FF);
|
|
79
|
+
const outsideUnion = new UnionIntervalNode([
|
|
80
|
+
new IntervalNode(MinusInfinityNode, roots[0], ineq.isStrict ? ClosureType.OO : ClosureType.OF),
|
|
81
|
+
new IntervalNode(roots[1], PlusInfinityNode, ineq.isStrict ? ClosureType.OO : ClosureType.FO),
|
|
82
|
+
]);
|
|
83
|
+
const tree = ineq.isSup
|
|
84
|
+
? aPositive
|
|
85
|
+
? outsideUnion
|
|
86
|
+
: insideInterval
|
|
87
|
+
: aPositive
|
|
88
|
+
? insideInterval
|
|
89
|
+
: outsideUnion;
|
|
90
|
+
return new InequationSolutionNode(tree);
|
|
91
|
+
};
|
|
92
|
+
const getInstruction = (identifiers) => {
|
|
93
|
+
const { coeffsF } = identifiers;
|
|
94
|
+
const [c, b, a] = coeffsF;
|
|
95
|
+
const nodeH = getInstructionNode(a, b, c);
|
|
96
|
+
return `Soit $f$ la fonction définie sur $\\mathbb{R}$ par :
|
|
97
|
+
|
|
98
|
+
$$
|
|
99
|
+
h(x) = ${nodeH.toTex()}
|
|
100
|
+
$$
|
|
101
|
+
|
|
102
|
+
Dresser le tableau de signes de $h'$ et de variations de $h$.
|
|
103
|
+
|
|
104
|
+
`;
|
|
105
|
+
};
|
|
106
|
+
const getInitTable = (identifiers) => {
|
|
107
|
+
const { coeffsF } = identifiers;
|
|
108
|
+
const [c, b, a] = coeffsF;
|
|
109
|
+
const nbRoots = getRootNodesOfDerivative(a, b, c).length;
|
|
110
|
+
if (nbRoots === 1) {
|
|
111
|
+
return [
|
|
112
|
+
["$x$", "", "\\ ", "", "\\ ", ""],
|
|
113
|
+
//sign
|
|
114
|
+
["$h'(x)$", "\\ ", "", "", "", "\\ "],
|
|
115
|
+
//var
|
|
116
|
+
["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
|
|
117
|
+
["$h(x)$", "\\ ", "", "", "", "\\ "],
|
|
118
|
+
["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
|
|
119
|
+
];
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
return [
|
|
123
|
+
["$x$", "", "\\ ", "", "\\ ", "", "\\ ", ""],
|
|
124
|
+
//sign
|
|
125
|
+
["$h'(x)$", "\\ ", "", "", "", "", "", "\\ "],
|
|
126
|
+
//var
|
|
127
|
+
["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
|
|
128
|
+
["$h(x)$", "\\ ", "", "", "", "", "", "\\ "],
|
|
129
|
+
["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
|
|
130
|
+
];
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
const getAnswerTable = (identifiers) => {
|
|
134
|
+
const { coeffsF } = identifiers;
|
|
135
|
+
const [c, b, a] = coeffsF;
|
|
136
|
+
const rootNodes = getRootNodesOfDerivative(a, b, c);
|
|
137
|
+
const nodeH = getInstructionNode(a, b, c);
|
|
138
|
+
const nodeHPrime = nodeH.derivative();
|
|
139
|
+
if (rootNodes.length === 1) {
|
|
140
|
+
const [rootNode] = rootNodes;
|
|
141
|
+
const rootNodeMinus1 = substract(rootNode, 1);
|
|
142
|
+
const hPrimeRootMinus1 = nodeHPrime.evaluate({
|
|
143
|
+
x: rootNodeMinus1.evaluate(),
|
|
144
|
+
});
|
|
145
|
+
const [strSignHPrimeRootMinus1, strSignHPrimeRootPlus1] = hPrimeRootMinus1 > 0 ? ["+", "-"] : ["-", "+"];
|
|
146
|
+
const nodeHRoot = nodeH
|
|
147
|
+
.toDetailedEvaluation({
|
|
148
|
+
x: rootNode,
|
|
149
|
+
})
|
|
150
|
+
.simplify();
|
|
151
|
+
return [
|
|
152
|
+
["$x$", "-\\infty", "\\ ", rootNode.toTex(), "\\ ", "+\\infty"],
|
|
153
|
+
//sign
|
|
154
|
+
[
|
|
155
|
+
"$h'(x)$",
|
|
156
|
+
"\\ ",
|
|
157
|
+
strSignHPrimeRootMinus1,
|
|
158
|
+
"0",
|
|
159
|
+
strSignHPrimeRootPlus1,
|
|
160
|
+
"\\ ",
|
|
161
|
+
],
|
|
162
|
+
//var
|
|
163
|
+
...(strSignHPrimeRootMinus1 === "+"
|
|
164
|
+
? [
|
|
165
|
+
["$\\ $", "\\ ", "\\ ", nodeHRoot.toTex(), "\\ ", "\\ "],
|
|
166
|
+
["$h(x)$", "\\ ", "\\nearrow", "\\ ", "\\searrow", "\\ "],
|
|
167
|
+
["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
|
|
168
|
+
]
|
|
169
|
+
: [
|
|
170
|
+
["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
|
|
171
|
+
["$h(x)$", "\\ ", "\\searrow", "\\ ", "\\nearrow", "\\ "],
|
|
172
|
+
["$\\ $", "\\ ", "\\ ", nodeHRoot.toTex(), "\\ ", "\\ "],
|
|
173
|
+
]),
|
|
174
|
+
];
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
const [rootNode1, rootNode2] = rootNodes;
|
|
178
|
+
const root1Minus1 = substract(rootNode1, 1);
|
|
179
|
+
const hPrimeRoot1Minus1 = nodeHPrime.evaluate({
|
|
180
|
+
x: root1Minus1.evaluate(),
|
|
181
|
+
});
|
|
182
|
+
const [strSignHPrimeRoot1Minus1, strSignHPrimeRootAvg, strSignHPrimeRoot2Plus1,] = hPrimeRoot1Minus1 > 0 ? ["+", "-", "+"] : ["-", "+", "-"];
|
|
183
|
+
const [nodeHRoot1, nodeHRoot2] = [rootNode1, rootNode2].map((nodeX) => nodeH
|
|
184
|
+
.toDetailedEvaluation({
|
|
185
|
+
x: nodeX,
|
|
186
|
+
})
|
|
187
|
+
.simplify());
|
|
188
|
+
return [
|
|
189
|
+
[
|
|
190
|
+
"$x$",
|
|
191
|
+
"-\\infty",
|
|
192
|
+
"\\ ",
|
|
193
|
+
rootNode1.toTex(),
|
|
194
|
+
"\\ ",
|
|
195
|
+
rootNode2.toTex(),
|
|
196
|
+
"\\ ",
|
|
197
|
+
"+\\infty",
|
|
198
|
+
],
|
|
199
|
+
//sign
|
|
200
|
+
[
|
|
201
|
+
"$h'(x)$",
|
|
202
|
+
"\\ ",
|
|
203
|
+
strSignHPrimeRoot1Minus1,
|
|
204
|
+
"0",
|
|
205
|
+
strSignHPrimeRootAvg,
|
|
206
|
+
"0",
|
|
207
|
+
strSignHPrimeRoot2Plus1,
|
|
208
|
+
"\\ ",
|
|
209
|
+
],
|
|
210
|
+
//var
|
|
211
|
+
...(strSignHPrimeRoot1Minus1 === "+"
|
|
212
|
+
? [
|
|
213
|
+
[
|
|
214
|
+
"$\\ $",
|
|
215
|
+
"\\ ",
|
|
216
|
+
"\\ ",
|
|
217
|
+
nodeHRoot1.toTex(),
|
|
218
|
+
"\\ ",
|
|
219
|
+
"\\ ",
|
|
220
|
+
"\\ ",
|
|
221
|
+
"\\ ",
|
|
222
|
+
],
|
|
223
|
+
[
|
|
224
|
+
"$h(x)$",
|
|
225
|
+
"\\ ",
|
|
226
|
+
"\\nearrow",
|
|
227
|
+
"\\ ",
|
|
228
|
+
"\\searrow",
|
|
229
|
+
"\\ ",
|
|
230
|
+
"\\nearrow",
|
|
231
|
+
"\\ ",
|
|
232
|
+
],
|
|
233
|
+
[
|
|
234
|
+
"$\\ $",
|
|
235
|
+
"\\ ",
|
|
236
|
+
"\\ ",
|
|
237
|
+
"\\ ",
|
|
238
|
+
"\\ ",
|
|
239
|
+
nodeHRoot2.toTex(),
|
|
240
|
+
"\\ ",
|
|
241
|
+
"\\ ",
|
|
242
|
+
],
|
|
243
|
+
]
|
|
244
|
+
: [
|
|
245
|
+
[
|
|
246
|
+
"$\\ $",
|
|
247
|
+
"\\ ",
|
|
248
|
+
"\\ ",
|
|
249
|
+
"\\ ",
|
|
250
|
+
"\\ ",
|
|
251
|
+
nodeHRoot2.toTex(),
|
|
252
|
+
"\\ ",
|
|
253
|
+
"\\ ",
|
|
254
|
+
],
|
|
255
|
+
[
|
|
256
|
+
"$h(x)$",
|
|
257
|
+
"\\ ",
|
|
258
|
+
"\\searrow",
|
|
259
|
+
"\\ ",
|
|
260
|
+
"\\nearrow",
|
|
261
|
+
"\\ ",
|
|
262
|
+
"\\searrow",
|
|
263
|
+
"\\ ",
|
|
264
|
+
],
|
|
265
|
+
[
|
|
266
|
+
"$\\ $",
|
|
267
|
+
"\\ ",
|
|
268
|
+
"\\ ",
|
|
269
|
+
nodeHRoot1.toTex(),
|
|
270
|
+
"\\ ",
|
|
271
|
+
"\\ ",
|
|
272
|
+
"\\ ",
|
|
273
|
+
"\\ ",
|
|
274
|
+
],
|
|
275
|
+
]),
|
|
276
|
+
];
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
const getHint = () => {
|
|
280
|
+
return `Commence par déterminer la fonction dérivée $h'$ de $h$. Puis, étudie le signe de $h'$ en résolvant l'inéquation $h'(x)\\geq 0$.
|
|
281
|
+
|
|
282
|
+
Enfin, sers-toi de la propriété suivante :
|
|
283
|
+
|
|
284
|
+
- si $h'$ est positive sur un intervalle $I$, alors $h$ est croissante sur $I$;
|
|
285
|
+
- si $h'$ est négative sur un intervalle $I$, alors $h$ est décroissante sur $I$.`;
|
|
286
|
+
};
|
|
287
|
+
const getCorrection = (identifiers) => {
|
|
288
|
+
const { coeffsF } = identifiers;
|
|
289
|
+
const [c, b, a] = coeffsF;
|
|
290
|
+
const rootNodes = getRootNodesOfDerivative(a, b, c);
|
|
291
|
+
const nodeH = getInstructionNode(a, b, c);
|
|
292
|
+
const nodeHPrime = nodeH.derivative();
|
|
293
|
+
if (rootNodes.length === 1) {
|
|
294
|
+
const [rootNode] = rootNodes;
|
|
295
|
+
const rootTex = rootNode.toTex();
|
|
296
|
+
const rootNodeMinus1 = substract(rootNode, 1);
|
|
297
|
+
const hPrimeRootMinus1 = nodeHPrime.evaluate({
|
|
298
|
+
x: rootNodeMinus1.evaluate(),
|
|
299
|
+
});
|
|
300
|
+
const signs = hPrimeRootMinus1 > 0 ? ["+", "-"] : ["-", "+"];
|
|
301
|
+
const signWords = signs.map((strSign) => strSign === "+" ? "positive" : "négative");
|
|
302
|
+
const words = signs.map((strSign) => strSign === "+" ? "croissante" : "décroissante");
|
|
303
|
+
const image = nodeH
|
|
304
|
+
.toDetailedEvaluation({
|
|
305
|
+
x: rootNode,
|
|
306
|
+
})
|
|
307
|
+
.simplify();
|
|
308
|
+
return `On calcule $h'$ :
|
|
309
|
+
|
|
310
|
+
$$
|
|
311
|
+
h'(x) = ${nodeHPrime.simplify().toTex()}
|
|
312
|
+
$$
|
|
313
|
+
|
|
314
|
+
On détermine ensuite le signe de $h'(x)$ :
|
|
315
|
+
|
|
316
|
+
${alignTex([
|
|
317
|
+
["", "h'(x) \\geq 0"],
|
|
318
|
+
["\\iff", nodeHPrime.simplify().toTex() + "\\geq 0"],
|
|
319
|
+
["\\iff", "x" + (b > 0 ? "\\geq" : "\\leq") + rootTex],
|
|
320
|
+
])}
|
|
321
|
+
|
|
322
|
+
$h'$ est donc ${signWords[0]} sur $]-\\infty; ${rootTex}]$, puis ${signWords[1]} sur $[${rootTex}; +\\infty[$.
|
|
323
|
+
|
|
324
|
+
On en conclut que $h$ est ${words[0]} sur $]-\\infty; ${rootTex}]$, puis ${words[1]} sur $[${rootTex}; +\\infty[$.
|
|
325
|
+
|
|
326
|
+
Pour compléter le tableau, il ne reste plus qu'à calculer l'image par $h$ de $${rootTex}$ :
|
|
327
|
+
|
|
328
|
+
$$
|
|
329
|
+
h\\left(${rootTex}\\right) = ${image.toTex()} = ${image.simplify().toTex()}
|
|
330
|
+
$$`;
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
const coeffs = zip([c, b, a], [b, 2 * a, 0]).map(([c1, c2]) => c1 + c2);
|
|
334
|
+
const inequationSolutionNode = getTrinomInequationSolutionNode(coeffs, "\\ge");
|
|
335
|
+
const arrIntervalNode = (() => {
|
|
336
|
+
if (isUnionIntervalNode(inequationSolutionNode.intervalSolution)) {
|
|
337
|
+
return inequationSolutionNode.intervalSolution.sets;
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
return [inequationSolutionNode.intervalSolution];
|
|
341
|
+
}
|
|
342
|
+
})();
|
|
343
|
+
return `On calcule $h'$ :
|
|
344
|
+
|
|
345
|
+
$$
|
|
346
|
+
h'(x) = ${nodeHPrime.simplify().toTex()}
|
|
347
|
+
$$
|
|
348
|
+
|
|
349
|
+
On détermine ensuite le signe de $h'(x)$ :
|
|
350
|
+
|
|
351
|
+
${alignTex([
|
|
352
|
+
["", "h'(x) \\geq 0"],
|
|
353
|
+
["\\iff", nodeHPrime.simplify().toTex() + "\\geq 0"],
|
|
354
|
+
["\\iff", frac(nodeHPrime, exp("x".toTree())).simplify().toTex() + "\\geq 0"],
|
|
355
|
+
])}
|
|
356
|
+
|
|
357
|
+
On résout l'inéquation :
|
|
358
|
+
|
|
359
|
+
$$
|
|
360
|
+
${inequationSolutionNode.toTex()}
|
|
361
|
+
$$
|
|
362
|
+
|
|
363
|
+
$h$ est donc croissante sur ${arrIntervalNode
|
|
364
|
+
.map((node) => `$${node.toTex()}$`)
|
|
365
|
+
.join(" et ")}.
|
|
366
|
+
|
|
367
|
+
On calcule enfin les extrema locaux de $h$.
|
|
368
|
+
|
|
369
|
+
`;
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
const getKeys = () => {
|
|
373
|
+
return ["infty"];
|
|
374
|
+
};
|
|
375
|
+
const isAnswerTableValid = (ans, { answerTable }) => {
|
|
376
|
+
try {
|
|
377
|
+
return varSignTableVEA(ans, answerTable);
|
|
378
|
+
}
|
|
379
|
+
catch (err) {
|
|
380
|
+
return handleVEAError(err);
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
const getSignVarTableProductFExpQuestion = (optsIn) => {
|
|
384
|
+
const opts = optsIn ?? optsDefault;
|
|
385
|
+
const { typeF } = opts;
|
|
386
|
+
const coeffsF = (() => {
|
|
387
|
+
switch (typeF) {
|
|
388
|
+
case "affine": {
|
|
389
|
+
const b = randint(-8, 9, [0]);
|
|
390
|
+
const c = randint(-4, 5) * b;
|
|
391
|
+
return [c, b];
|
|
392
|
+
}
|
|
393
|
+
case "second degré": {
|
|
394
|
+
// return TrinomConstructor.randomNiceRoots().coefficients;
|
|
395
|
+
//we want integer roots for h'
|
|
396
|
+
const b = randint(1, 11);
|
|
397
|
+
return [1, b, 1];
|
|
398
|
+
}
|
|
399
|
+
default:
|
|
400
|
+
throw new Error("Unsupported typeF: " + typeF);
|
|
401
|
+
}
|
|
402
|
+
})();
|
|
403
|
+
const identifiers = {
|
|
404
|
+
coeffsF,
|
|
405
|
+
};
|
|
406
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
407
|
+
};
|
|
408
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
409
|
+
return {
|
|
410
|
+
answerTable: getAnswerTable(identifiers),
|
|
411
|
+
instruction: getInstruction(identifiers),
|
|
412
|
+
keys: getKeys(identifiers),
|
|
413
|
+
answerFormat: "tex",
|
|
414
|
+
identifiers,
|
|
415
|
+
options: opts,
|
|
416
|
+
hint: getHint(identifiers),
|
|
417
|
+
correction: getCorrection(identifiers),
|
|
418
|
+
initTable: getInitTable(identifiers),
|
|
419
|
+
};
|
|
420
|
+
};
|
|
421
|
+
const optsDefault = {
|
|
422
|
+
typeF: "affine",
|
|
423
|
+
};
|
|
424
|
+
const options = [
|
|
425
|
+
{
|
|
426
|
+
id: "typeF",
|
|
427
|
+
label: "Fonction $f$",
|
|
428
|
+
type: GeneratorOptionType.select,
|
|
429
|
+
target: GeneratorOptionTarget.generation,
|
|
430
|
+
values: ["affine", "second degré"],
|
|
431
|
+
defaultValue: optsDefault.typeF,
|
|
432
|
+
},
|
|
433
|
+
];
|
|
434
|
+
export const signVarTableProductFExp = {
|
|
435
|
+
id: "signVarTableProductFExp",
|
|
436
|
+
label: "Dresser le tableau de variations de $x \\mapsto f(x)\\exp(x)$",
|
|
437
|
+
isSingleStep: true,
|
|
438
|
+
generator: (nb, opts) => getDistinctQuestions(() => getSignVarTableProductFExpQuestion(opts), nb),
|
|
439
|
+
options,
|
|
440
|
+
qcmTimer: 60,
|
|
441
|
+
freeTimer: 60,
|
|
442
|
+
isAnswerTableValid,
|
|
443
|
+
subject: "Mathématiques",
|
|
444
|
+
getInstruction,
|
|
445
|
+
getHint,
|
|
446
|
+
getCorrection,
|
|
447
|
+
getAnswerTable,
|
|
448
|
+
getQuestionFromIdentifiers,
|
|
449
|
+
hasHintAndCorrection: true,
|
|
450
|
+
answerType: "signVarTable",
|
|
451
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
coeffsF: number[];
|
|
4
|
+
isFOverExp: boolean;
|
|
5
|
+
};
|
|
6
|
+
type Options = {
|
|
7
|
+
typeF: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const signVarTableQuotientFExp: Exercise<Identifiers, Options>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=signVarTableQuotientFExp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signVarTableQuotientFExp.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/signVarTableQuotientFExp.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAsIrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAubF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAiBF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBnE,CAAC"}
|